/// <summary> /// Initializes this configuration control to default values. /// /// <seealso cref="PluginEnvironment"/> /// </summary> /// <param name="environment">Information about the plug-in environment.</param> public void Initialize(PluginEnvironment environment) { // Initialize the activity data. _data = new SafeComInstallerActivityData(); safecom_assetSelectionControl.Initialize(AssetAttributes.ControlPanel); bundleFile_textBox.Text = string.Empty; safecom_serverComboBox.Initialize("SafeCom"); }
/// <summary> /// Provides plug-in configuration data for an existing activity, including plug-in /// specific metadata, a metadata version, and selections of assets and documents. /// /// The custom metadata can be retrieved from the configuration using one of the /// <c>GetMetadata</c> methods, which return either a deserialized object or the XML. This /// data is then used to populate the configuration control. Asset and Document information /// can be retrieved using. The metadata version is included for forwards compatibility. /// </summary> /// <param name="configuration">The configuration data.</param> /// <param name="environment">Information about the plug-in environment.</param> public void Initialize(PluginConfigurationData configuration, PluginEnvironment environment) { // Initialize the activity data by deserializing it from an existing copy of the // configuration information. _data = configuration.GetMetadata <SafeComInstallerActivityData>(); safecom_assetSelectionControl.Initialize(configuration.Assets, AssetAttributes.ControlPanel); safecom_serverComboBox.Initialize(configuration.Servers.SelectedServers.FirstOrDefault(), "SafeCom"); bundleFile_textBox.Text = _data.BundleFile; tasks_comboBox.SelectedItem = _data.SafeComAction; UpdateSafeComConfigurationUi(_data.SafeComConfigurationCollection); }
/// <summary> /// This method should return a new <see cref="PluginConfigurationData"/> object containing /// all the configuration from the control. (This is the same object used in Initialize.) /// Custom metadata is passed into the constructor, either as XML or an object that will be /// serialized. The metadata version can be set to any value other than null. /// /// Selection data for assets and documents is set using the Assets and Documents /// properties. Plug-ins that will not make use of Assets and/or Documents can ignore these /// properties. /// /// <seealso cref="PluginConfigurationData"/> /// </summary> /// <returns>The configuration data.</returns> public PluginConfigurationData GetConfiguration() { _data = new SafeComInstallerActivityData { BundleFile = bundleFile_textBox.Text, SafeComAction = (SafeComAdministratorAction)tasks_comboBox.SelectedItem, SafeComConfigurationCollection = GetSafeComConfiguration() }; return(new PluginConfigurationData(_data, "1.0") { Assets = safecom_assetSelectionControl.AssetSelectionData, Servers = new ServerSelectionData(safecom_serverComboBox.SelectedServer) }); }