public HatchStyleSelectionProperty(string ResourceId, HatchStyleList hsl, HatchStyle preselect, bool includeUndefined) { hatchStyleList = hsl; resourceId = ResourceId; if (includeUndefined) { base.choices = new string[hatchStyleList.Count + 1]; for (int i = 0; i < hatchStyleList.Count; ++i) { HatchStyle hst = hatchStyleList[i]; choices[i + 1] = hst.Name; } string undef = StringTable.GetString("HatchStyle.Undefined"); // sollte es den Namen schon geben, werden solange "-" davor und dahintergemacht, bis es den Namen mehr gibt while (hatchStyleList.Find(undef) != null) { undef = "-" + undef + "-"; } choices[0] = undef; if (preselect != null) { selectedText = preselect.Name; } else { selectedText = undef; } } else { base.choices = new string[hatchStyleList.Count]; for (int i = 0; i < hatchStyleList.Count; ++i) { HatchStyle hst = hatchStyleList[i]; choices[i] = hst.Name; } if (preselect != null) { selectedText = preselect.Name; } } }
public HatchStyleSelectionProperty(string ResourceId, HatchStyleList hsl, IHatchStyle iHatchStyle, bool includeUndefined) : this(ResourceId, hsl, iHatchStyle.HatchStyle, includeUndefined) { this.iHatchStyle = iHatchStyle; toWatch = iHatchStyle as IGeoObject; }