private List<LegendUtility> GetStyleStructLegend(string title, StyleStruct ss) { List<LegendUtility> list = new List<LegendUtility>(); List<LegendUtility.LegendUtil> cutline = new List<LegendUtility.LegendUtil>(); foreach (GeoPointStyle style in ss.Styles) { LegendUtility.LegendUtil item = new LegendUtility.LegendUtil(style.SymbolValue, style.SymbolFont.FontFamily, style.SymbolFont.Style, (float)style.IconSize.Width, style.Color, style.Name); cutline.Add(item); } LegendUtility utility = new LegendUtility(title, cutline); list.Add(utility); return list; }
private void AddColorsToLegend(Dictionary<string, Pen> vector) { if (this.checkBox_Legend.Checked) { List<LegendUtility.LegendUtil> cutline = new List<LegendUtility.LegendUtil>(); foreach (KeyValuePair<string, Pen> pair in vector) { LegendUtility.LegendUtil item = new LegendUtility.LegendUtil(pair.Value.Color, pair.Key); cutline.Add(item); } LegendUtility utility = new LegendUtility(this.m_CurrentLegendUtilName, cutline); this.m_LM.Add("GIS", new LegendUtility[] { utility }); this.m_lutil = cutline; } else { this.m_LM.Clear("GIS", new string[] { this.m_CurrentLegendUtilName }); } }
public void LoadPrjtLegend(string name, List<LegendUtility.LegendUtil> lutil) { LegendUtility utility = new LegendUtility(name, lutil); this.m_LM.Add("GIS", new LegendUtility[] { utility }); }
private void OnColorLegendDisplay(object sender) { EventHandler<ColorLegendArgs> colorLegendDisplay = this.ColorLegendDisplay; ColorLegendArgs e = new ColorLegendArgs(); if (this.m_Current != null) { if (this.display1.IsAddToLegend) { e = new ColorLegendArgs(); e.CategoryName = this.m_Current.Properties2DisplayAll.Name; e.LegendParams = this.display1.CurrentSetLegend; List<LegendUtility.LegendUtil> cutline = this.ConvertDisplayArgsToLegendUtil(e.LegendParams); LegendUtility utility = new LegendUtility(e.CategoryName, cutline); this.m_legendmanager.Add("GIS", new LegendUtility[] { utility }); this.m_TypeName = e.CategoryName; this.m_lutil = cutline; } else { this.m_legendmanager.Clear("GIS", new string[] { this.m_Current.Properties2DisplayAll.Name }); } if (this.display1.IsAddToLegend && (colorLegendDisplay != null)) { colorLegendDisplay(sender, e); } } }