IDtsComponentUI.Edit(IWin32Window, Variables, Connections) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当编辑组件时调用。
public:
bool Edit(System::Windows::Forms::IWin32Window ^ parentWindow, Microsoft::SqlServer::Dts::Runtime::Variables ^ variables, Microsoft::SqlServer::Dts::Runtime::Connections ^ connections);
public bool Edit (System.Windows.Forms.IWin32Window parentWindow, Microsoft.SqlServer.Dts.Runtime.Variables variables, Microsoft.SqlServer.Dts.Runtime.Connections connections);
abstract member Edit : System.Windows.Forms.IWin32Window * Microsoft.SqlServer.Dts.Runtime.Variables * Microsoft.SqlServer.Dts.Runtime.Connections -> bool
Public Function Edit (parentWindow As IWin32Window, variables As Variables, connections As Connections) As Boolean
参数
- parentWindow
- IWin32Window
SSIS 设计器的 System.Windows.Forms.IWin32Window。
- connections
- Connections
包含该组件的数据流任务可访问的 Connections 集合。
返回
true 的值指定组件已修改。
示例
以下示例演示了该方法的示例实现 Edit 。 在此示例中,将创建一个新窗口,并显示为对话框。 System.Windows.Forms.Form.DialogResult 属性用于确定是否修改组件,控制函数的返回值。
public bool Edit(IWin32Window parentWindow, Microsoft.SqlServer.Dts.Runtime.Variables variables, Microsoft.SqlServer.Dts.Runtime.Connections connections)
{
// Pass the dtsComponentMetaData parameter received
// in the Initialize method.
MyUI myUI = new MyUI(dtsComponentMetaData);
if (myUI.ShowDialog(parentWindow) == DialogResult.OK)
return true;
else
return false;
}
Public Function Edit(ByVal parentWindow As IWin32Window, ByVal variables As Microsoft.SqlServer.Dts.Runtime.Variables, ByVal connections As Microsoft.SqlServer.Dts.Runtime.Connections) As Boolean
Dim myUI As MyUI = New MyUI(dtsComponentMetaData)
If myUI.ShowDialog(parentWindow) = DialogResult.OK Then
Return True
Else
Return False
End If
End Function
注解
在 SSIS 设计器中编辑组件时调用此方法。 使用此方法创建和显示实现组件用户界面的窗口。
该 connections
集合提供对 ConnectionManager 包中对象的访问。 可以使用此集合显示组件能够使用的对象列表 ConnectionManager 。
此方法的 true
返回值通知设计器已修改组件,导致包被标记为脏,以及其他 UI 元素(如 PropertyGrid)更新。
在 SSIS 设计器中显示窗口时,使用 parentWindow
参数确保窗口显示在设计器的工作区中。