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
系統。Windows。Forms.IWin32SSIS 設計器視窗。
- connections
- Connections
包含 Connections 該元件的資料流任務可存取的集合。
傳回
值為真表示該元件已被修改。
範例
以下範例展示了該 Edit 方法的範例實作。 在此範例中,會建立一個新視窗並以對話框形式顯示。 系統。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 參數確保視窗顯示在設計器的用戶端區域內。