IDtsComponentUI 接口
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重要
此 API 不符合 CLS。
定义了SSIS设计器为数据流组件用户界面调用的方法。
public interface class IDtsComponentUI
[System.CLSCompliant(false)]
public interface IDtsComponentUI
[<System.CLSCompliant(false)>]
type IDtsComponentUI = interface
Public Interface IDtsComponentUI
- 属性
示例
以下代码示例展示了实现该 <xref:Microsoft.SqlServer.Dts.Pipeline.Design.IdtsComponentUI> 接口的类。 欲了解更多信息及完整示例,请参见“为 数据流 组件开发用户界面”。
using System;
using System.Windows.Forms;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Pipeline.Design;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
namespace Microsoft.Samples.SqlServer.Dts
{
public class SampleComponentUI : IDtsComponentUI
{
IDTSComponentMetaData100 md;
IServiceProvider sp;
public void Help(System.Windows.Forms.IWin32Window parentWindow)
{
}
public void New(System.Windows.Forms.IWin32Window parentWindow)
{
}
public void Delete(System.Windows.Forms.IWin32Window parentWindow)
{
}
public bool Edit(System.Windows.Forms.IWin32Window parentWindow, Variables vars, Connections cons)
{
// Create the component's form, and then display it.
SampleComponentUIForm componentEditor = new SampleComponentUIForm(cons, vars, md);
DialogResult result = componentEditor.ShowDialog(parentWindow);
if (result == DialogResult.OK)
return true;
return false;
}
public void Initialize(IDTSComponentMetaData100 dtsComponentMetadata, IServiceProvider serviceProvider)
{
// Store the component metadata.
this.md = dtsComponentMetadata;
}
}
}
Imports System
Imports System.Windows.Forms
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Pipeline.Design
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Public Class SampleComponentUI
Implements IDtsComponentUI
Private md As IDTSComponentMetaData100
Private sp As IServiceProvider
Public Sub Help(ByVal parentWindow As System.Windows.Forms.IWin32Window)
End Sub
Public Sub New(ByVal parentWindow As System.Windows.Forms.IWin32Window)
End Sub
Public Sub Delete(ByVal parentWindow As System.Windows.Forms.IWin32Window)
End Sub
Public Function Edit(ByVal parentWindow As System.Windows.Forms.IWin32Window, ByVal vars As Variables, ByVal cons As Connections) As Boolean
Dim componentEditor As SampleComponentUIForm = New SampleComponentUIForm(cons, vars, md)
Dim result As DialogResult = componentEditor.ShowDialog(parentWindow)
If result = DialogResult.OK Then
Return True
End If
Return False
End Function
Public Sub Initialize(ByVal dtsComponentMetadata As IDTSComponentMetaData100, ByVal serviceProvider As IServiceProvider)
Me.md = dtsComponentMetadata
End Sub
End Class
注解
组件开发者可以通过指定类型并在属性属性DtsPipelineComponentAttribute中实现该接口UITypeName,为数据流组件提供用户界面。 当组件在SSIS设计器内添加、删除和编辑组件时,设计器调用该接口的方法。
方法
| 名称 | 说明 |
|---|---|
| Delete(IWin32Window) |
当组件从 SSIS Designer 表面被删除时调用。 |
| Edit(IWin32Window, Variables, Connections) |
当组件被编辑时调用。 |
| Help(IWin32Window) |
[预留以后使用。] |
| Initialize(IDTSComponentMetaData100, IServiceProvider) |
调用以初始化组件的用户界面。 |
| New(IWin32Window) |
当组件首次添加到 数据流 任务时调用。 |