protected override void Init() { base.Init(); XProp xprop; xprop = new XProp(); xprop.Category = "输入"; xprop.Name = "输入"; xprop.Value = new XList <string>(); xprop.ProType = typeof(XList <string>); xprop.Converter = new XListConverter <string>(); Settings.Add(xprop); xprop = new XProp(); xprop.Category = "输出"; xprop.Name = "输出格式"; xprop.Value = ""; xprop.ProType = typeof(string); Settings.Add(xprop); xprop = new XProp(); xprop.Category = "输出"; xprop.Name = "输出"; xprop.Value = "stringFormat输出名"; xprop.ProType = typeof(string); Settings.Add(xprop); }
protected override void Init() { base.Init(); XProp xprop; xprop = new XProp(); xprop.Category = "输出"; xprop.Name = "键"; xprop.Value = "Key"; xprop.ProType = typeof(string); Settings.Add(xprop); xprop = new XProp(); xprop.Category = "输出"; xprop.Name = "类型"; xprop.Value = "0"; xprop.Converter = new MyComboItemConvert("UInt16,Int16,UInt32,Int32,Double,Single,Boolean,String,UInt16[],Int16[],UInt32[],Int32[],Double[],Single[],Boolean[],String[]"); xprop.ProType = typeof(MyComboItemConvert); xprop.ValueChanged = DataTypeChanged; Settings.Add(xprop); xprop = new XProp(); xprop.Category = "参数"; xprop.Name = "值"; xprop.ProType = typeof(ushort); Settings.Add(xprop); }
protected override void Init() { base.Init(); XProp xprop; xprop = new XProp(); xprop.Category = "参数"; xprop.Name = "扫码枪Id"; xprop.Value = "0"; xprop.ProType = typeof(MyComboItemConvert); Settings.Add(xprop); xprop = new XProp(); xprop.Category = "输出"; xprop.Name = "输出"; xprop.Value = "条码"; xprop.ProType = typeof(string); Settings.Add(xprop); xprop = new XProp(); xprop.Category = "输入"; xprop.Name = "输入"; xprop.Value = new XList <string>(); xprop.ProType = typeof(XList <string>); xprop.Converter = new XListConverter <string>(); Settings.Add(xprop); }
private void DataTypeChanged(object typeObject) { string typeStr = GetPropValue("类型").ToString(); Type type = Type.GetType("System." + typeStr); XProp prop = Settings.Find(item => item.Name == "值"); prop.ProType = type; prop.Value = null; MainForm.UpdatePropertyGridEvent(); }
protected override void Init() { base.Init(); XProp xprop; xprop = new XProp(); xprop.Category = "参数"; xprop.Name = "PLC"; xprop.Value = "0"; xprop.ProType = typeof(MyComboItemConvert); Settings.Add(xprop); xprop = new XProp(); xprop.Category = "参数"; xprop.Name = "地址"; xprop.Value = 1; xprop.ProType = typeof(int); Settings.Add(xprop); xprop = new XProp(); xprop.Category = "参数"; xprop.Name = "长度"; xprop.Value = 1; xprop.ProType = typeof(int); Settings.Add(xprop); xprop = new XProp(); xprop.Category = "参数"; xprop.Name = "读取类型"; xprop.Value = "0"; xprop.Converter = new MyComboItemConvert("UInt16,Int16,UInt32,Int32,Double,Single,Boolean,String,Byte"); xprop.ProType = typeof(MyComboItemConvert); Settings.Add(xprop); xprop = new XProp(); xprop.Category = "输出"; xprop.Name = "输出"; xprop.Value = new XList <string>(); xprop.ProType = typeof(XList <string>); xprop.Converter = new XListConverter <string>(); Settings.Add(xprop); xprop = new XProp(); xprop.Category = "输出"; xprop.Name = "显示"; xprop.ProType = typeof(bool); xprop.Value = true; Settings.Add(xprop); xprop = new XProp(); xprop.Category = "输入"; xprop.Name = "输入"; xprop.Value = new XList <string>(); xprop.ProType = typeof(XList <string>); xprop.Converter = new XListConverter <string>(); Settings.Add(xprop); }
protected virtual void Init() { XProp xprop = new XProp(); xprop.Category = "身份"; xprop.Description = "保存时生成,具有唯一性"; xprop.Name = "ID"; xprop.ReadOnly = true; xprop.Value = "-1"; xprop.ProType = typeof(int); Settings.Add(xprop); }
protected override void Init() { base.Init(); XProp xprop; xprop = new XProp(); xprop.Category = "参数"; xprop.Name = "变量名"; xprop.ProType = typeof(ModelRoi); xprop.Value = null;//new ModelRoi(1, "A"); xprop.EditorType = typeof(Editor1); Settings.Add(xprop); }
protected override void Init() { base.Init(); XProp xprop; xprop = new XProp(); xprop.Category = "参数"; xprop.Name = "变量名"; xprop.ProType = typeof(string); xprop.Value = ""; Settings.Add(xprop); xprop = new XProp(); xprop.Category = "参数"; xprop.Name = "对比值"; xprop.ProType = typeof(string); xprop.Value = ""; Settings.Add(xprop); }
protected override void Init() { base.Init(); XProp xprop; xprop = new XProp(); xprop.Category = "参数"; xprop.Name = "方法"; xprop.Value = "0"; assembly = Assembly.LoadFrom("MesAdapter.dll"); var methods = assembly.GetType(ConfigurationManager.AppSettings["MesAdapter"]) .GetMethods().Where(item => item.IsPublic && item.ReturnType == typeof(Result)); string methodsStr = ""; foreach (var item in methods) { methodsStr += item.Name; if (!item.Equals(methods.Last())) { methodsStr += ","; } } xprop.Converter = new MyComboItemConvert(methodsStr); xprop.ProType = typeof(MyComboItemConvert); Settings.Add(xprop); xprop = new XProp(); xprop.Category = "参数"; xprop.Name = "参数"; xprop.Value = new XList <string>(); xprop.ProType = typeof(XList <string>); xprop.Converter = new XListConverter <string>(); Settings.Add(xprop); xprop = new XProp(); xprop.Category = "输入"; xprop.Name = "输入"; xprop.Value = new XList <string>(); xprop.ProType = typeof(XList <string>); xprop.Converter = new XListConverter <string>(); Settings.Add(xprop); }
protected override void Init() { base.Init(); XProp xprop; xprop = new XProp(); xprop.Category = "参数"; xprop.Name = "PLC"; xprop.Value = "0"; xprop.ProType = typeof(MyComboItemConvert); Settings.Add(xprop); xprop = new XProp(); xprop.Category = "参数"; xprop.Name = "地址"; xprop.Value = 1; xprop.ProType = typeof(int); Settings.Add(xprop); xprop = new XProp(); xprop.Category = "参数"; xprop.Name = "写入类型"; xprop.Value = "0"; xprop.Converter = new MyComboItemConvert("UInt16,Int16,UInt32,Int32,Double,Single,Boolean,String,Byte"); xprop.ProType = typeof(MyComboItemConvert); xprop.ValueChanged = DataTypeChanged; Settings.Add(xprop); xprop = new XProp(); xprop.Category = "参数"; xprop.Name = "写入值"; xprop.Value = new XList <ushort>() { 1 }; xprop.ProType = typeof(XList <ushort>); xprop.Converter = new XListConverter <ushort>(); //xprop.ProType = typeof(ushort[]); Settings.Add(xprop); }
private void DataTypeChanged(object typeObject) { string typeStr = GetPropValue("写入类型").ToString(); Type type = Type.GetType("System." + typeStr); XProp prop = Settings.Find(item => item.Name == "写入值"); if (type == typeof(string)) { prop.Value = ""; prop.ProType = type; prop.Converter = null; } else { var instanceType = Type.GetType("TKS.FlowChart.Tool.XList`1").MakeGenericType(type); prop.Value = Activator.CreateInstance(instanceType); prop.ProType = instanceType; var ConverterType = Type.GetType("TKS.FlowChart.Tool.XListConverter`1").MakeGenericType(type); prop.Converter = (TypeConverter)Activator.CreateInstance(ConverterType); } MainForm.UpdatePropertyGridEvent(); }
public XPropDescriptor(XProp prop, Attribute[] attrs) : base(prop.Name, attrs) { theProp = prop; }