C#创建动态添加的组件 [英] C# creating components to add dynamically
问题描述
您好,
我们正在尝试创建一个新项目。项目需要通过添加组件来扩展(我想通过创建dll?)。这些组件需要与项目分开创建。
主项目需要读取带组件的目录。如果存在组件,则需要实现组件代码。
每个组件都是一个小程序,但每个组件都不能单独工作。主项目需要实现每个组件。如果有更多组件,则必须包含每个组件以扩展项目。
最好的方法是什么?
我们刚刚开始,所以我们可以走各方面。
谢谢!
DMK
Hello,
We are trying to create a new project. The project needs to be expandable by adding components (I think by creating dll's?). These components need to be created separately from the project.
The main project needs to read a dir with components. If a component exists, the component code needs to be implemented.
Every component will be a small programm but every component will not work on its own. The main project needs to implement every component. If there are more components, every component must be included to expand the project.
What is the best way to do this?
We are just starting so we can go every way.
Thank you!
DMK
推荐答案
你应该实现PlugIn
架构模式。
这是一个例子:使用C#的插件架构 [ ^ ]
You should implement thePlugIn
architectural pattern.
Here is an example: Plugin Architecture using C#[^]
这篇关于C#创建动态添加的组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!