コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: ScanTool.cs プロジェクト: lian5599/NewSolution
        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);
        }
コード例 #4
0
        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();
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
ファイル: MesTool.cs プロジェクト: lian5599/NewSolution
        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);
        }
コード例 #10
0
ファイル: PlcWriteTool.cs プロジェクト: lian5599/NewSolution
        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);
        }
コード例 #11
0
ファイル: PlcWriteTool.cs プロジェクト: lian5599/NewSolution
        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();
        }
コード例 #12
0
ファイル: ExPropHelper.cs プロジェクト: lian5599/NewSolution
 public XPropDescriptor(XProp prop, Attribute[] attrs) : base(prop.Name, attrs)
 {
     theProp = prop;
 }