C# - What is a component and how is it typically used?(C# - 什么是组件,它通常如何使用?)
问题描述
什么是组件类,我通常会在哪里使用它?
What is a component class and where would I typically use one?
当我在 VS.NET 2008 中向我的项目添加新项目时,其中一个选项是添加组件.我什至不确定我是否了解组件是什么 - 但我肯定想了解更多关于它们的信息.
When I add a new item to my project in VS.NET 2008 one of the options is to add a component. I am not even sure I understand what a component is - but I would sure like to find out a bit more about them.
有人可以向我解释一下吗,或者可以向我指出一个对我有帮助的在线教程.
Could somebody explain them to me or perhaps point me towards an online tutorial that would help me.
推荐答案
嗯,一般来说,组件是事物的任何部分.特别是在 .NET 中,组件是一个实现 IComponent
接口,表示一个类可以和它的逻辑容器交互.
Well, generally speaking, a component is any part of a thing. Specifically in .NET, a component is a class that implements the IComponent
interface, which indicates that a class can interact with it's logical container.
您通常会以设计支持的形式看到这一点,因为类在设计器中与其宿主交互,但这不是严格要求.
More often than not, you see this in the form of design support, in that classes interact with their host in the designer, but that's not a strict requirement.
这篇关于C# - 什么是组件,它通常如何使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:C# - 什么是组件,它通常如何使用?


- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- 输入按键事件处理程序 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01