CSharp make plugin(Addin) program C# 编写基于插件的程序

来源:互联网 发布:淘宝手游代充的秘密 编辑:程序博客网 时间:2024/06/13 22:56

   为了使软件具有更好的可重用性和可扩展性,提出了插件(Plug-in)的思想并,国外一些优秀的都是基于此写的.ie,firefox,eclipse等等...具体理论知识我也不多说了,从网上摘了两段.....

 

In computing, a plug-in (also: plugin, addin, add-in, addon, add-on, snap-in or snapin; but see also extension) consists of a computer program that interacts with a host application (a web browser or an email client, for example) to provide a certain, usually very specific, function "on demand". Often, add-on is considered the general term comprising plugins, extensions, and themes as subcategories[citation needed].

Applications support plugins for many reasons. Some of the main reasons include:

  • to enable third-party developers to create capabilities to extend an application
  • to support features yet unforeseen
  • to reduce the size of an application
  • to separate source code from an application because of incompatible software licenses.

Examples of applications and their plug-ins include:

  • Microsoft Office uses plug-ins (better known as add-ins) to extend the capabilities of its application by adding custom commands and specialized features
  • Rockbox, a firmware for digital audio players, can use plug-ins, for example: play games, use the text editor
  • Email clients use plug-ins to decrypt and encrypt email (Pretty Good Privacy) or to send oversized email attachments (Globalscape Mail Express)
  • Graphics software use plug-ins to support file formats and process images (Adobe Photoshop)
  • Media players use plug-ins to support file formats and apply filters (foobar2000, GStreamer, Quintessential, VST, Winamp, XMMS)
  • Packet sniffers use plug-ins to decode packet formats (OmniPeek)
  • Remote sensing applications use plug-ins to process data from different sensor types (Opticks)
  • Software development environments use plug-ins to support programming languages (Eclipse, jEdit, MonoDevelop)
  • Web browsers use plug-ins to play video and presentation formats (Flash, QuickTime, Microsoft Silverlight, 3DMLW)
  • Some digital mixing consoles allow plug-ins to extend features such as reverberation effects, equalization and compression.
  • Some Web content management systems use plug-ins to increase functionality.

基本原理:

The host application provides services which the plug-in can use,including a way for plug-ins to register themselves with the hostapplication and a protocolfor the exchange of data with plug-ins. Plug-ins depend on the servicesprovided by the host application and do not usually work by themselves.Conversely, the host application operates independently of theplug-ins, making it possible for end-users to add and update plug-insdynamically without needing to make changes to the host application.

Open application programming interfaces(APIs) provide a standard interface, allowing third parties to createplug-ins that interact with the host application. A stable API allowsthird-party plug-ins to continue to function as the original versionchanges and to extend the life-cycle of obsolete applications. The Adobe Photoshop and After Effects plug-in APIs have become a standard[citation needed] and competing applications such as Corel Paint Shop Pro have adopted them to some extent. Other examples of such APIs include Audio Units and VST.

Games and productivity applications often use plug-in architectureswhich allow original and third-party publishers to add functionality.

The Microsoft Flight Simulator series has become well-known for its aircraft add-ons.

Outside software, a network switch may ship with an unoccupied but non-standard port to accommodate various optional physical-layer connectors.

Outside software again, manufacturers can use plug-ins to create vendor lock-in by limiting upgrade options solely to those available from or endorsed by the original manufacturer. IBM's Micro Channel Architecture, technically superior to Industry Standard Architectureas a way to add components to IBM PCs, largely failed to gain widesupport due to the difficulty in getting certification for third-partydevices.

 

上面这边原文的连接地址为:http://en.wikipedia.org/wiki/Plug-in_%28computing%29#Plug-ins_and_extensions

csdn里有有一篇介绍插件实现的bolog:http://blog.csdn.net/stella_tangxing/archive/2005/04/28/366850.aspx

 

在我的资源里有一个我用CSharp写的一个简单的程序,阐述了插件的具体实现.....或者邮件告我我发给你们...请您多多指教.....