TaskInfo.IconResource 属性

定义

包含在图形用户界面中表示此任务时要使用的图标的 .resource 文件或 .resx 文件的名称。 此值为只读的。

public:
 property System::String ^ IconResource { System::String ^ get(); };
public string IconResource { get; }
member this.IconResource : string
Public ReadOnly Property IconResource As String

属性值

一个字符串,其中包含用于在图形用户界面中表示任务的图标的名称。

示例

以下代码从应用程序检索 TaskInfos 集合,循环访问集合中的每个属性,然后打印每个属性 TaskInfo 的值,包括该 IconResource属性。

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;

namespace TaskType
{
    class Program
    {
        static void Main(string[] args)
        {
            Application myApp = new Application();
            TaskInfos tInfos = myApp.TaskInfos;

            // Iterate through the collection, 
            // printing values for the properties.
            foreach (TaskInfo tInfo in tInfos)
            {
                Console.WriteLine("CreationName:   {0}", tInfo.CreationName);
                Console.WriteLine("Description     {0}", tInfo.Description);
                Console.WriteLine("FileName        {0}", tInfo.FileName);
                // Console.WriteLine("FileNameVersionString   {0}", tInfo.FileNameVersionString);
                Console.WriteLine("IconFile        {0}", tInfo.IconFile);
                Console.WriteLine("IconResource    {0}", tInfo.IconResource);
                Console.WriteLine("ID              {0}", tInfo.ID);
                Console.WriteLine("Name            {0}", tInfo.Name);
                // Console.WriteLine("TaskContact     {0}", tInfo.TaskContact);
                Console.WriteLine("TaskType        {0}", tInfo.TaskType);
                Console.WriteLine("UITypeName      {0}", tInfo.UITypeName);
                Console.WriteLine("----------------------------");
            }
            Console.WriteLine();
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime


Namespace TaskType
    _
   Class Program
      
      'Entry point which delegates to C-style main Private Function
      Public Overloads Shared Sub Main()
         Main(System.Environment.GetCommandLineArgs())
      End Sub
      
      Overloads Shared Sub Main(args() As String)
         Dim myApp As New Application()
         Dim tInfos As TaskInfos = myApp.TaskInfos
         
         ' Iterate through the collection, 
         ' printing values for the properties.
         Dim tInfo As TaskInfo
         For Each tInfo In  tInfos
            Console.WriteLine("CreationName:   {0}", tInfo.CreationName)
            Console.WriteLine("Description     {0}", tInfo.Description)
            Console.WriteLine("FileName        {0}", tInfo.FileName)
            ' Console.WriteLine("FileNameVersionString   {0}", tInfo.FileNameVersionString)
            Console.WriteLine("IconFile        {0}", tInfo.IconFile)
            Console.WriteLine("IconResource    {0}", tInfo.IconResource)
            Console.WriteLine("ID              {0}", tInfo.ID)
            Console.WriteLine("Name            {0}", tInfo.Name)
            ' Console.WriteLine("TaskContact     {0}", tInfo.TaskContact)
            Console.WriteLine("TaskType        {0}", tInfo.TaskType)
            Console.WriteLine("UITypeName      {0}", tInfo.UITypeName)
            Console.WriteLine("----------------------------")
         Next tInfo
         Console.WriteLine()
      End Sub 'Main
   End Class 'Program
End Namespace 'TaskType

示例输出:

CreationName: Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptTask, Microsoft.SqlServer.ScriptTask, Version=10.0.000.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91

Description Provides interactive custom task authoring

FileName Microsoft.SqlServer.ScriptTask

IconFile Microsoft.SqlServer.ScriptTask

IconResource TaskIcon

ID Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptTask, Microsoft.SqlServer.ScriptTask, Version=10.0.000.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91

Name Script Task

TaskType DTS100

UITypeName Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptTaskUI, Microsoft.SqlServer.ScriptTaskUI, Version=10.00.000.00, Culture=Neutral, PublicKeyToken=89845dcd8080cc91

----------------------------

CreationName: Microsoft.SqlServer.Dts.Tasks.SendMailTask.SendMailTask, Microsoft.SqlServer.SendMailTask, Version=10.0.000.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91

Description Sends an e-mail message.

FileName Microsoft.SqlServer.SendMailTask

IconFile Microsoft.SqlServer.SendMailTask

IconResource TaskIcon

ID Microsoft.SqlServer.Dts.Tasks.SendMailTask.SendMailTask, Microsoft.SqlServer.SendMailTask, Version=10.0.000.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91

Name Send Mail Task

TaskType DTS100

UITypeName Microsoft.SqlServer.Dts.Tasks.SendMailTask.SendMailTaskUI, Microsoft.SqlServer.SendMailTaskUI, Version=10.00.000.00, Culture=Neutral, PublicKeyToken=89845dcd8080cc91

----------------------------

适用于