In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to develop the WPF plug-in in .NET Framework 3.5. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
Plug-ins have other names, such as add-on or plug-in.
I have previously studied that SharpDevelop,SharpDevelop uses the framework-the extensible architecture of plug-ins. After all, the level of code is relatively high, and I haven't learned thoroughly about its plug-in development style.
The System.Addin namespace of .NET Framework 3.5 makes plug-in development much easier.
1. What is AddIns?
Allows you to add assemblies dynamically while the application is running.
Plug-in development can add functionality to the completed application. We can create a host application and add more and more features to it over time, which can be written by the development team or by other vendors to create plug-ins to extend the application.
The design goals of 2.AddIns (MAF) are as follows
Applications are easy to develop plug-ins
Efficiently find plug-ins at run time
Developing host programs should be a simple process, but not as easy as developing plug-ins
Plug-ins and host applications should be maintained and upgraded independently
3.MAF architecture
The MAF architecture is based on a pipeline of seven assemblies. This pipeline solves the problem of the version of the plug-in. Because the dependencies between assemblies in the pipeline are low, contracts, host programs, and plug-ins can be upgraded to new versions without interfering with each other at all.
Undefined
The following picture is the Chinese description of the above picture:
The following figure is the plug-in development structure class diagram
With this model, the plug-in side and the host side can be upgraded completely independently, but using the mapping layer. For example, if a new version of the host uses entirely new methods and properties, the contract can remain the same, only the adapter needs to be modified. You can also define a new contract. The adapter can be modified or several contracts can be used at the same time.
The following figure shows the appearance of the MAF architecture as a single plug-in. If we want to create more plug-ins (such as demo applications), we must create new classes to inherit the plug-in adapter to accomplish this function.
4. Plug-in model folder structure
Except for the AddIns directory, all directories directly contain assemblies for specific parts of the pipe. The AddIns directory contains a subdirectory for each plug-in assembly. Plug-ins can also be stored in directories that are completely independent of other pipeline components.
MAF needs to use reflection to load dynamically to get all the information about the plug-in. Also, for many plug-ins, this increases the startup time of the host application. Therefore, MAF uses a cache to hold information about pipe components. The cache is created by the program that installs the plug-in, and if the host application has write access to the pipe directory, the cache is created by the host application.
In the directory structure, there is a PipelineSegments.store file, which is an add-in and has two tasks:
◆ registers information about all add-ins and pipeline segments in the cache file.
◆ finds the add-in of the specified host view of the add-in through the search cache
There will be an Addins.store file in the AddIns folder, which is used to make the program look for plug-ins to be displayed in the application.
Application plug-in development is indeed of great benefit to the application system, many applications use plug-in development, such as Visual Studio, Eclipse, and browsers IE, FF, although we are not developers of these software, we can still add the functions we need in these software, plug-in development is easier to maintain and upgrade the system, and it is also of great help to improve the efficiency of the program.
On the Internet on the Addins sample code is relatively few, I found two, we study.
This is the end of how to develop the WPF plug-in in .NET Framework 3.5. I hope the above content can be of some help and learn more. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.