Пример #1
0
        /// <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 <see cref="ConfigurationServices"/>. The metadata version is
        /// included for forwards compatibility.
        ///
        /// <seealso cref="ConfigurationServices"/>
        /// </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 <RoboActionActivityData>();

            duration_timeSpanControl.Value = _data.DurationTimeSpan;
            pin_numericUpDown.Value        = _data.PinNumber;
            pi_ipAddressControl.Text       = _data.PiAddress;
            port_numericUpDown.Value       = _data.PiPort;
        }
Пример #2
0
 /// <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 RoboActionActivityData();
     duration_timeSpanControl.Value = TimeSpan.FromSeconds(1);
 }