/// <summary> /// /// </summary> /// <param name="i"></param> /// <param name="key"></param> /// <returns></returns> public Style getStyle(int i, StyleMap.Pair.styleStateEnum key) { Style style = new Style(this.styles[i].id, new IconStyle(this.styles[i].iconStyle.scale, this.styles[i].iconStyle.icon, this.styles[i].iconStyle.hotSpot)); if (key == StyleMap.Pair.styleStateEnum.normal) { style.id = "sn_" + style.id; } else { style.id = "sh_" + style.id; style.iconStyle.scale += 0.2f; } return style; }
private void Icons_NoIcon_button_Click(object sender, EventArgs e) { if (this.Icons_SymbolCategories_listBox.SelectedItems.Count > 0) { string selectedItem; Style noIconStyle = new Style("NoIcon", new IconStyle(0f, new excel2earth.kml.Icon(), new IconStyle.vec2(0d, 0d, IconStyle.vec2.unitsEnum.fraction, IconStyle.vec2.unitsEnum.fraction))); noIconStyle.iconStyle.color = Color.Transparent; StyleMap noIconStyleMap = new StyleMap("msn_NoIcon", new StyleMap.Pair(StyleMap.Pair.styleStateEnum.normal, noIconStyle), new StyleMap.Pair(StyleMap.Pair.styleStateEnum.normal, noIconStyle)); noIconStyleMap.normal.style.id = "sn_" + noIconStyleMap.normal.style.id; noIconStyleMap.highlight.style.id = "sh_" + noIconStyleMap.highlight.style.id; for (int i = 0; i < this.Icons_SymbolCategories_listBox.SelectedItems.Count; i++) { selectedItem = this.Icons_SymbolCategories_listBox.SelectedItems[i].ToString(); this.iconSelection[selectedItem] = -1; this.styleSelection[selectedItem] = noIconStyleMap; } this.Icons_SymbolCategories_listBox_SelectedIndexChanged(sender, e); } else { MessageBox.Show("You must select a category first."); } }