| | |
| | | // set => hash = value; |
| | | //} |
| | | |
| | | public abstract Hashtable GetConvertHash(); |
| | | public abstract Hashtable GetConvertHash(ITypeDescriptorContext context); |
| | | |
| | | public override bool GetStandardValuesSupported(ITypeDescriptorContext context) |
| | | { |
| | |
| | | |
| | | public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) |
| | | { |
| | | Hash = GetConvertHash(); |
| | | Hash = GetConvertHash(context); |
| | | |
| | | string[] ids = new string[Hash.Values.Count]; |
| | | int i = 0; |
| | |
| | | { |
| | | return (value as IComplexDisplay).GetDisplayText(); |
| | | } |
| | | else |
| | | else if (value is IEnumerable enumList) |
| | | { |
| | | string display = ""; |
| | | bool iComplexDisplayMatch = false; |
| | | var enumrator = enumList.GetEnumerator(); |
| | | while (enumrator.MoveNext()) |
| | | { |
| | | if (enumrator.Current is IComplexDisplay d) |
| | | { |
| | | iComplexDisplayMatch = true; |
| | | display += $"{d.GetDisplayText()} "; |
| | | } |
| | | } |
| | | |
| | | if (iComplexDisplayMatch) |
| | | { |
| | | return display.Trim(); |
| | | } |
| | | } |
| | | |
| | | { |
| | | return JsonConvert.SerializeObject(value); |
| | | } |
| | |
| | | } |
| | | |
| | | form.ShowDialog(); |
| | | List<string> returnStrs = tbox.Text.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries).ToList(); |
| | | List<string> returnStrs = tbox.Text.Split(new char[] { '\r', '\n', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); |
| | | |
| | | switch (typeof(T).Name) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | public class DeviceTypeConverter : StringConverter |
| | | public class DeviceTypeConverter : StringConverter |
| | | { |
| | | public override bool GetStandardValuesSupported(ITypeDescriptorContext context) |
| | | { |
| | |
| | | return new StandardValuesCollection(devices); |
| | | } |
| | | } |
| | | |
| | | |
| | | public class DeviceInitialConfigEditor<T> : UITypeEditor where T : class, IInitialConfig |
| | | { |
| | | public override UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context) |