public static TEdit CreatEdit <TEdit>(TEdit edit = null, RepositoryItemCollection collection = null, Action <TEdit> initialize = null) where TEdit : RepositoryItem, new() { edit = edit ?? new TEdit(); if (collection != null) { collection.Add(edit); } if (initialize != null) { initialize(edit); } return(edit); }
public static RepositoryItemDateEdit CreatDateEdit(RepositoryItemDateEdit edit = null, RepositoryItemCollection collection = null) { return(CreatEdit <RepositoryItemDateEdit>(edit, collection)); }
public static RepositoryItemImageComboBox CreateEnumImageComboBox <TEnum>(RepositoryItemImageComboBox edit = null, RepositoryItemCollection collection = null, Converter <TEnum, string> displayTextConverter = null) { return(CreatEdit <RepositoryItemImageComboBox>(edit, collection, (e) => e.Items.AddEnum <TEnum>(displayTextConverter))); }
public static RepositoryItemImageComboBox CreateManeuverImageComboBox(RepositoryItemImageComboBox edit = null, RepositoryItemCollection collection = null) { RepositoryItemImageComboBox ret = CreateEnumImageComboBox <DevExpress.XtraMap.BingManeuverType>(edit, collection); foreach (ImageComboBoxItem item in ret.Items) { switch ((DevExpress.XtraMap.BingManeuverType)item.Value) { case DevExpress.XtraMap.BingManeuverType.DepartStart: item.ImageIndex = 0; break; case DevExpress.XtraMap.BingManeuverType.TurnLeft: item.ImageIndex = 1; break; case DevExpress.XtraMap.BingManeuverType.TurnRight: item.ImageIndex = 2; break; case DevExpress.XtraMap.BingManeuverType.ArriveFinish: item.ImageIndex = 3; break; case DevExpress.XtraMap.BingManeuverType.UTurn: item.ImageIndex = 4; break; case DevExpress.XtraMap.BingManeuverType.BearLeft: item.ImageIndex = 5; break; case DevExpress.XtraMap.BingManeuverType.BearRight: item.ImageIndex = 6; break; } item.Description = string.Empty; } ret.SmallImages = CreateBingManeuverTypeImageCollection(); ret.GlyphAlignment = HorzAlignment.Center; return(ret); }
public static RepositoryItemImageComboBox CreateTaskPriorityImageComboBox(RepositoryItemImageComboBox edit = null, RepositoryItemCollection collection = null) { RepositoryItemImageComboBox ret = CreateEnumImageComboBox <EmployeeTaskPriority>(edit, collection); ret.SmallImages = CreateTaskPriorityImageCollection(); if (edit == null) { ret.GlyphAlignment = HorzAlignment.Center; } return(ret); }
public static RepositoryItemImageComboBox CreatePersonPrefixImageComboBox(RepositoryItemImageComboBox edit = null, RepositoryItemCollection collection = null) { RepositoryItemImageComboBox ret = CreateEnumImageComboBox <PersonPrefix>(edit, collection); ret.SmallImages = CreatePersonPrefixImageCollection(); if (edit == null) { ret.GlyphAlignment = HorzAlignment.Center; } return(ret); }
public static RepositoryItemImageComboBox CreateShipmentStatusImageComboBox(ISkinProvider provider, RepositoryItemImageComboBox edit = null, RepositoryItemCollection collection = null) { RepositoryItemImageComboBox ret = CreateEnumImageComboBox <ShipmentStatus>(edit, collection); ret.SmallImages = CreateShipmentStatusImageCollection(provider); if (edit == null) { ret.GlyphAlignment = HorzAlignment.Center; } return(ret); }