Share via


DtsPipelineComponentAttribute.IconResource 属性

定义

获取或设置用于表示工具箱中的组件的图标。

public:
 property System::String ^ IconResource { System::String ^ get(); void set(System::String ^ value); };
public string IconResource { get; set; }
member this.IconResource : string with get, set
Public Property IconResource As String

属性值

一个字符串,该字符串标识用于表示工具箱中的该组件的图标资源。

示例

以下示例演示提供图标资源的组件类。

using System;  
using Microsoft.SqlServer.Dts.Pipeline;  
namespace DtsDocumentation  
{  
   [DtsPipelineComponent(DisplayName="MyComponent",IconResource="DtsDocumentation.MyComponentIcon.ico")]  
   public class MyComponent : PipelineComponent  
   {  
   }  
}  
Imports System   
Imports Microsoft.SqlServer.Dts.Pipeline   
Namespace DtsDocumentation   

 <DtsPipelineComponent(DisplayName="MyComponent", IconResource="DtsDocumentation.MyComponentIcon.ico")> _   
 Public Class MyComponent   
 Inherits PipelineComponent   
 End Class   
End Namespace  

注解

此属性控制将组件添加到数据流时显示在数据流工具箱和数据流选项卡的设计图面上的图标。

数据流工具箱使用 16x16、16 色图像类型,而数据流选项卡的设计图面使用 32x32、16 色图像类型。 两者都是使用 Microsoft Visual Studio 创建的图标的默认图像类型。

标识图标资源的字符串的格式是虚线表示法,由程序集的根命名空间的名称组成,后跟句点,然后是图标文件的名称。

若要使用 Visual Studio 将图标文件作为资源嵌入程序集中,请创建新图标,然后将图标文件的生成操作属性设置为 Visual Studio 属性窗口中的嵌入资源

适用于