When and why should I implement IComponent, IContainer, and ISite?
Asked Answered
H

1

29

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?

Hagfish answered 7/11, 2008 at 20:57 Comment(0)
S
15

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.

Slob answered 7/11, 2008 at 21:40 Comment(2)
What is the usability of Container & Component for creating a networkable application?Pinter
its just a pattern/common framework to implement component based software. this book "Programming .NET Components" is great!Sancho

© 2022 - 2024 — McMap. All rights reserved.