private string CreateExpLegendForStudyXml(IDiscreteStudy study) { string str = ""; str = (str + "<studyNode name = \"" + study.Name + "\">\r\n") + "<Discrete_values>\r\n"; int num = 0; foreach (GeoDiscreteSytle sytle in study.StyleList) { num = sytle.Color.ToArgb(); object obj2 = str; str = string.Concat(new object[] { obj2, "<Row color=\"", num, "\" value=\"", sytle.Value, "\" legend=\"", sytle.FeatureName, "\"> </Row>\r\n" }); } return (str + "</Discrete_values>\r\n" + "</studyNode>\r\n"); }
private bool IsXMLValidateForStudy(IDiscreteStudy study, XmlDocument doc) { bool flag = true; XmlNode node = doc.ChildNodes[1]; XmlNode node2 = node.ChildNodes[0]; XmlNode node3 = node.ChildNodes[0].ChildNodes[0]; if (((node2.ChildNodes.Count == 0) || !node2.Attributes["name"].Value.Equals(study.Name)) || (node3.ChildNodes.Count != study.StyleList.Count)) { return false; } int result = 0; short num2 = 0; foreach (XmlNode node4 in node3.ChildNodes) { flag &= int.TryParse(node4.Attributes["color"].Value, out result); flag &= short.TryParse(node4.Attributes["value"].Value, out num2); flag &= node4.Attributes["legend"].Value != null; if (!flag) { return flag; } } return flag; }
private void GetDiscreteLegend(IPredictionGroup group, IDiscreteStudy study) { short num = 0; float regionArea = 0f; float num3 = 0f; float percentage = 0f; Dictionary<short, int> dictionary = this.psm.CalculateRate(study); if (this.m_Group.Region != null) { regionArea = (float) this.m_Group.Region.RegionArea; } if (dictionary != null) { string key = group.Name + study.Name; if (!this.m_DiscreteCluterCoverage.ContainsKey(key)) { this.GetClutterCoverage(study, key); } Dictionary<GeoRasterStyle, List<double>> dictionary2 = this.m_DiscreteCluterCoverage[key]; for (int i = 0; i < study.StyleList.Count; i++) { short num6 = Convert.ToInt16(study.StyleList[i].Value); this.dgvExpoertData.Rows.Add(); string featureName = study.StyleList[i].FeatureName; Color color = study.StyleList[i].Color; percentage = ((float) dictionary[num6]) / ((float) this.m_Group.NumPointInPolygon); percentage = this.SolvePrecisionBelow_1(percentage); num3 = regionArea * percentage; this.m_GroupArea += num3; this.m_GroupPercentage += percentage; num3 = this.SolvePrecision((double) num3, this.m_Mode); this.dgvExpoertData.Rows[this.m_Index].Cells["GroupNameOrLegend"].Value = this.m_EmptyString + featureName; this.dgvExpoertData.Rows[this.m_Index].Cells["CoverArea"].Value = num3; this.dgvExpoertData.Rows[this.m_Index].Cells["Percentage"].Value = this.SolvePrecision((double) (percentage * 100f), this.m_Mode) + "%"; List<double> list = dictionary2[study.StyleList[i]]; for (int j = 0; j < this.m_Clutters.Count; j++) { this.dgvExpoertData.Rows[this.m_Index].Cells[this.m_Clutters[j]].Value = this.SolvePrecision(list[j] * 100.0, this.m_Mode) + "%"; } this.m_Index++; num = (short) (num + 1); } this.m_GroupPercentage = this.SolvePrecisionBelow_1(this.m_GroupPercentage); this.m_GroupArea = this.SolvePrecision((double) this.m_GroupArea, 4); if (dictionary2.Keys.Count > 0) { this.GetCumulatePer(dictionary2.Keys.Count); } } }
private void ImportLegendXmlForStudy(IDiscreteStudy study, XmlDocument doc, DataGridView dataGridView) { XmlNode node = doc.ChildNodes[1]; XmlNode node2 = node.ChildNodes[0].ChildNodes[0]; string str2 = string.Empty; string str3 = string.Empty; int argb = 0; dataGridView.Rows.Clear(); int num2 = 0; foreach (XmlNode node3 in node2.ChildNodes) { argb = int.Parse(node3.Attributes["color"].Value); str2 = node3.Attributes["value"].Value; str3 = node3.Attributes["legend"].Value; num2 = dataGridView.Rows.Add(); dataGridView.Rows[num2].Cells["ColorType"].Value = Color.FromArgb(argb); dataGridView.Rows[num2].Cells["value"].Value = str2; dataGridView.Rows[num2].Cells["Legend"].Value = str3; dataGridView.Rows[num2].Cells["CheckLegend"].Value = true; } dataGridView.Refresh(); }
private void GetClutterCoverage(IDiscreteStudy study, string key) { study.Open(this.m_IProjectManager); this.m_DiscreteCluterCoverage.Add(key, this.m_IAnalyDispEvent.GetStudyClutterCoverage(new PredictionGeoDataStructure(study), study.StyleList.ToGeoRasterStyleList())); study.Close(false); }