/// <summary> /// Initializes the configuration control with the specified settings. /// </summary> /// <param name="configuration"></param> /// <param name="environment"></param> public void Initialize(PluginConfigurationData configuration, PluginEnvironment environment) { _data = configuration.GetMetadata <FlashFirmwareActivityData>(); firmware_assetSelectionControl.Initialize(configuration.Assets, AssetAttributes.None); if (!File.Exists(_data.FirmwareFileName)) { MessageBox.Show(@"The firmware file is no longer available and might have been moved. Please add the firmware file detail again.", @"Firmware File Missing", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } else { textBoxFirmwareFile.Text = _data.FirmwareFileName; } checkBoxAutoBackup.Checked = _data.AutoBackup; checkBoxValidate.Checked = _data.ValidateFlash; validatetimeSpanControl.Value = _data.ValidateTimeOut == TimeSpan.FromMinutes(0) ? TimeSpan.FromMinutes(1) : _data.ValidateTimeOut; BashCollectorServiceHostCheck(environment); radioButtonDowngrade.Checked = _data.IsDowngrade; switch (_data.FlashMethod) { default: ews_radioButton.Checked = true; break; case FlashMethod.ControlPanel: controlPanel_radioButton.Checked = true; break; case FlashMethod.Bios: { int comPortIndex = port_comboBox.Items.IndexOf(_data.ComPort); if (comPortIndex == -1) { //check if the comport mentioned is telnet ip or COM if (_data.ComPort.StartsWith("COM", StringComparison.OrdinalIgnoreCase)) { MessageBox.Show( $@"The serial port {_data.ComPort} is not available currently. Please check the BashLogCollectorHost and try again!", @"Port Unavailable", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } port_comboBox.DataSource = null; _portList.Add(_data.ComPort); port_comboBox.DataSource = _portList; port_comboBox.SelectedItem = _data.ComPort; } else { port_comboBox.SelectedIndex = comPortIndex; } bios_radioButton.Checked = true; } break; } }
/// <summary> /// Initializes the configuration control with default settings. /// </summary> /// <param name="environment"></param> public void Initialize(PluginEnvironment environment) { _data = new FlashFirmwareActivityData(); validatetimeSpanControl.Value = TimeSpan.FromMinutes(5.0); BashCollectorServiceHostCheck(environment); }