private void InitializePluginControl(IPluginConfigurationControl configurationControl) { Dictionary <string, string> settings = new Dictionary <string, string>(); using (EnterpriseTestContext context = new EnterpriseTestContext()) { foreach (SystemSetting pluginSetting in context.SystemSettings.Where(n => n.Type.Equals("PluginSetting") && n.SubType.Equals(_metadata.MetadataType))) { settings.Add(pluginSetting.Name, pluginSetting.Value); } } PluginEnvironment environment = new PluginEnvironment ( new SettingsDictionary(settings), GlobalSettings.Items[Setting.Domain], GlobalSettings.Items[Setting.DnsDomain] ); if (string.IsNullOrEmpty(_metadata.Metadata)) { configurationControl.Initialize(environment); } else { PluginConfigurationData configurationData = _metadata.BuildConfigurationData(); configurationControl.Initialize(configurationData, environment); } _editorType = _metadata.MetadataType; _editor = configurationControl; }
private void InitializeConfigurationControl() { // Only SystemTrace should be useable during constructor _simulator.SetServiceContext(FrameworkServicesContext.ConfigurationConstructor); _configurationControl = _simulator.CreateConfigurationControl(); // Initialize the rest of the configuration services _simulator.SetServiceContext(FrameworkServicesContext.Configuration); // Call Initialize for the new control if (_configurationControl != null) { _configurationControl.ConfigurationChanged += configurationControl_ConfigurationChanged; _configurationControl.Initialize(_simulator.Environment); } // Add control to the UI SetPanelControl(pluginConfigurationPanel, _configurationControl as Control); SetUnsavedChanges(false); }