private void CreateCurrentSetProperty(string filePath) { CurrentSetProperty e = new CurrentSetProperty(); if (File.Exists(filePath)) { XmlDocument document = new XmlDocument(); document.Load(filePath); XmlNode firstChild = document.FirstChild.FirstChild; Dictionary<string, FieldType> dictionary = new Dictionary<string, FieldType>(); dictionary.Add("State", FieldType.State); dictionary.Add("Mobility", FieldType.Name | FieldType.Terminal | FieldType.Code); dictionary.Add("Service", FieldType.Service); dictionary.Add("Terminal", FieldType.Name | FieldType.Terminal); dictionary.Add("UserProfile", FieldType.SpatialMutilplexingGainFactor | FieldType.CIStandardDeviation_dB); Dictionary<string, FontStyle> fontStyleDic = new Dictionary<string, FontStyle>(); fontStyleDic.Add(FontStyle.Bold.ToString(), FontStyle.Bold); fontStyleDic.Add(FontStyle.Italic.ToString(), FontStyle.Italic); fontStyleDic.Add(FontStyle.Regular.ToString(), FontStyle.Regular); fontStyleDic.Add(FontStyle.Strikeout.ToString(), FontStyle.Strikeout); fontStyleDic.Add(FontStyle.Underline.ToString(), FontStyle.Underline); e.DType = DisplayType.DiscreteValues; XmlNode node2 = firstChild.FirstChild; e.FType = dictionary[node2.Attributes[0].Value]; int num = int.Parse(node2.Attributes[1].Value); Dictionary<short, SymbolElement> dictionary3 = new Dictionary<short, SymbolElement>(); Dictionary<short, string> dictionary4 = new Dictionary<short, string>(); for (int i = 0; i < num; i++) { XmlNode node3 = node2.ChildNodes[i]; short key = short.Parse(node3.Attributes[0].Value); float size = float.Parse(node3.Attributes["EMSize"].Value); FontFamily fontfamily = new FontFamily(node3.Attributes["FontFamily"].Value); FontStyle fontstyle = this.getXmlFontStyle(fontStyleDic, node3.Attributes["Style"].Value); Color fontcolor = this.getXmlColor(node3.Attributes["ForeColor"].Value); int num5 = int.Parse(node3.Attributes["SymbolValue"].Value); string str = node3.Attributes["Legend"].Value; SymbolElement element = new SymbolElement(num5, fontfamily, fontstyle, size, fontcolor); dictionary3.Add(key, element); dictionary4.Add(key, str); } e.Name = "SimulationSymbol"; e.OutDiscreteSymbolMap = dictionary3; e.OutDiscreColorMap = new Dictionary<short, Color>(); e.OutDiscreteLegendMap = dictionary4; SimulationDisProperty property2 = new SimulationDisProperty(this.m_SubSysInterface); property2.Correct(e); this.m_SimGroupManager.SimlationDisProperty = property2; this.FT = e.FType; this.DT = e.DType; this.isfirst = false; this.m_CurrentSetProperty = e; this.m_SimlationDisProperty = property2; this.ChangeNodeMsg(this.m_CurrentSetProperty); } }
private void propertiesToolStripMenuItem_Click(object sender, EventArgs e) { ColorForm form; if (!(this.isFirstAddGroup || !this.isfirst)) { this.m_SimlationDisProperty = new SimulationDisProperty(this.m_SubSysInterface); } else { this.m_SimlationDisProperty = this.m_SimGroupManager.SimlationDisProperty; } this.m_TempSimlationDisProperty = new SimulationDisProperty(this.m_SubSysInterface); this.m_TempSimlationDisProperty.SynchronizationSymbolElement(this.m_SimlationDisProperty); if (!this.isfirst) { form = new ColorForm(this.m_TempSimlationDisProperty, this.DT, this.FT); } else { form = new ColorForm(this.m_TempSimlationDisProperty); } form.FormButtonClick += new EventHandler<ColorFormAction>(this.cf_FormButtonClick); form.ValueChanged = true; form.KeyPreview = true; form.KeyDown += new KeyEventHandler(this.SimulationContextMenuView_KeyDown); form.HelpButton = true; form.HelpButtonClicked += new CancelEventHandler(this.SimulationContextMenuView_HelpButtonClicked); form.StartPosition = FormStartPosition.CenterParent; form.ShowDialog(); }
private void cf_FormButtonClick(object sender, ColorFormAction e) { this.m_SimlationDisProperty = this.m_TempSimlationDisProperty; this.ChangeNodeMsg(e.CurrentSet); this.m_CurrentSetProperty = e.CurrentSet; this.DT = e.CurrentSet.DType; this.FT = e.CurrentSet.FType; this.isfirst = false; this.m_TempSimlationDisProperty.Correct(e.CurrentSet); this.m_SimGroupManager.SimlationDisProperty = this.m_SimlationDisProperty; ProjectSingleton.CurrentProject.NeedPromptSave = true; }
public void InitPropertyToDisplay() { if (this.m_SimlationDisProperty == null) { this.m_SimlationDisProperty = new SimulationDisProperty(this.m_subSysInterface); } }