private void cmbType_SelectedIndexChanged(object sender, System.EventArgs e) { switch (cmbType.SelectedIndex) { case 0: if (CurrentOlIcon == null) { CurrentOlIcon = new OlIcon(); } CurrentOlImage = CurrentOlIcon; break; case 1: if (CurrentOlCircle == null) { CurrentOlCircle = new OlCircle(); } CurrentOlImage = CurrentOlCircle; break; case 2: if (CurrentOlPolygon == null) { CurrentOlPolygon = new OlPolygon(); } CurrentOlImage = CurrentOlPolygon; break; } propertyGrid1.SelectedObject = CurrentOlImage; }
private void setLoadedObject(OlStyle.OlImage img) { switch (img.GetType().Name) { case "OlIcon": CurrentOlImage = CurrentOlIcon = (OlIcon)img; cmbType.SelectedIndex = 0; break; case "OlCircle": CurrentOlImage = CurrentOlCircle = (OlCircle)img; cmbType.SelectedIndex = 1; break; case "OlPolygon": CurrentOlImage = CurrentOlPolygon = (OlPolygon)img; cmbType.SelectedIndex = 2; break; } }