什么时候和为什么要我实现IComponent的,的IContainer和的ISite?什么时候、要我、IComponent、IContainer

2023-09-02 10:49:15 作者:岁月并非如歌

我想了半天什么IComponent的,的IContainer和的ISite是。我读过的文档,但它是非常模糊的(或者说我想这个问题太用力)。我知道,如果我创建一个类作为一个组件,它可以在Visual Studio设计使用。但我真的想知道更普遍:?什么组件/容器模式完成,并可以将它让我的生活更轻松。

I've wondered for a long time what IComponent, IContainer, and ISite are for. I've read the documentation, but it is extremely vague (or I'm thinking about it too hard). I know that if I create a class as a component, it can be used in the Visual Studio designer. But I'd really like to know more generally: what does the Component/Container pattern accomplish, and can it make my life easier?

推荐答案

它们是管道的Windows窗体设计器。你很少有自己实现这些,只是源于组件的组件类。开始担心他们,当你想实现自己的设计师。这样做甚至少有记载。

They are plumbing for the Windows Forms designer. You rarely have to implement them yourself, just derive your component class from Component. Start worrying about them when you want to implement your own designer. Doing so is even less documented.