Exemplo n.º 1
0
        private List <EntityComValueJson> GetSelComEditorValues()
        {
            FieldInfo[] fields = LCReflect.GetTypeFieldInfos(SelCom);

            List <EntityComValueJson> comValues = new List <EntityComValueJson>();

            for (int i = 0; i < fields.Length; i++)
            {
                FieldInfo         info = fields[i];
                ComValueAttribute comValueAttribute = LCReflect.GetFieldAttr <ComValueAttribute>(info);
                if (comValueAttribute != null)
                {
                    if (comValueAttribute.ViewEditor)
                    {
                        comValues.Add(new EntityComValueJson()
                        {
                            Name  = info.Name,
                            Type  = info.FieldType.ToString(),
                            Value = "",
                        });
                    }
                }
            }
            return(comValues);
        }
Exemplo n.º 2
0
        public EntityComView(string comName, FieldInfo[] fieldInfos, BaseCom baseCom)
        {
            ComName = comName;
            ComAttribute comAttribute = LCReflect.GetTypeAttr <ComAttribute>(baseCom.GetType());

            if (comAttribute != null)
            {
                ComName = comAttribute.ViewName;
            }
            for (int i = 0; i < fieldInfos.Length; i++)
            {
                FieldInfo       info     = fieldInfos[i];
                ComKeyValueView keyValue = new ComKeyValueView(info.Name, info, baseCom);

                ComValueAttribute comValueAttribute = LCReflect.GetFieldAttr <ComValueAttribute>(info);
                if (comValueAttribute != null)
                {
                    if (comValueAttribute.ViewEditor)
                    {
                        EditorValueList.Add(keyValue);
                    }
                    else
                    {
                        if (comValueAttribute.ShowView)
                        {
                            ValueList.Add(keyValue);
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void GetEditorNodeKeyValue()
        {
            Type nodeType = LCReflect.GetType(Json.TypeFullName);

            FieldInfo[] fields = LCReflect.GetTypeFieldInfos(nodeType);

            for (int i = 0; i < fields.Length; i++)
            {
                FieldInfo          info = fields[i];
                NodeValueAttribute nodeValueAttribute = LCReflect.GetFieldAttr <NodeValueAttribute>(info);
                if (nodeValueAttribute != null)
                {
                    if (nodeValueAttribute.ViewEditor)
                    {
                        object defauleValue = LCReflect.GeTypeDefaultFieldValue(Json.TypeFullName, info.Name);
                        UpdateNodeKeyValue(info, defauleValue);
                    }
                }
            }
        }