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# - 什么是组件,它通常如何使用?
基础教程推荐
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- 如何激活MC67中的红灯 2022-01-01