private void comboBoxType_SelectedIndexChanged(object sender, EventArgs e) { try { string s = comboBoxType.SelectedItem + ""; if (s.Length == 0) { return; } if (pIndicator != null) { Control cont = pIndicator as Control; panelChart.Controls.Remove(cont); } pIndicator = SimplePointsIdicator.Indicator[s]; pIndicator.Positions = indicator; Control c = pIndicator as Control; panelChart.Controls.Add(c); indicatorType = s; pIndicator.Blocked = false; } catch (Exception ex) { ex.ShowError(10); WindowsExtensions.ControlExtensions.ShowMessageBoxModal(ex.Message); } }
/// <summary> /// Default costructor /// </summary> public SimplePointsIdicator() { prototype = new Motion6D.Drawing.Indicators.SimplePointsIdicator( ControlProxy.GetProxy(this)); prototypeInterface = prototype; InitializeComponent(); Dock = DockStyle.Fill; }
/// <summary> /// Post operation /// </summary> public void Post() { string[] s = SimplePointsIdicator.Indicator[indicator]; comboBoxType.FillCombo(s); comboBoxType.SelectCombo(indicatorType); comboBoxType.SelectedIndexChanged += comboBoxType_SelectedIndexChanged; if (indicatorType.Length > 0) { pIndicator = SimplePointsIdicator.Indicator[indicatorType]; if (indicator != null) { pIndicator.Positions = indicator; Control c = pIndicator as Control; panelChart.Controls.Add(c); pIndicator.Blocked = false; } } }