Exemple #1
0
        private static void FillNestedMultiNode(OBJS.Data DataSet, Type BaseType, object Item, string DefaultItemName)
        {
            List <PropertyInfo> NestedProps = GetProprites(OBJS.Types.NestedMulitNode, BaseType);

            foreach (PropertyInfo NestedProp in NestedProps)
            {
                OBJS.XMLDatabaseRetriveItem XMLDatabaseRetriveItem = (OBJS.XMLDatabaseRetriveItem)NestedProp.GetCustomAttributes(typeof(OBJS.XMLDatabaseRetriveItem), true).FirstOrDefault();

                string DataSetName = (XMLDatabaseRetriveItem.DataSet == string.Empty) ? NestedProp.Name : XMLDatabaseRetriveItem.DataSet;
                DefaultItemName = (XMLDatabaseRetriveItem.ItemName != string.Empty) ? XMLDatabaseRetriveItem.ItemName : DefaultItemName;

                Type ListType = NestedProp.PropertyType.GetGenericArguments()[0];

                System.Collections.IList IList = (System.Collections.IList)NestedProp.GetValue(Item, null);
                if (IList != null)
                {
                    OBJS.Data Data = new OBJS.Data();
                    Data.DataSet        = DataSetName;
                    Data.IsSettingsItem = true;

                    foreach (Object ListItem in IList)
                    {
                        FillData(Data, ListType, ListItem);
                    }
                    DataSet.SetRetriveValue(Data);
                }
            }
        }
Exemple #2
0
        private static void FillNestedData(OBJS.Data DataSet, Type BaseType, object Item, string DefaultItemName)
        {
            List <PropertyInfo> NestedSettings = GetProprites(OBJS.Types.NestedList, BaseType);

            foreach (PropertyInfo Prop in NestedSettings)
            {
                OBJS.XMLDatabaseRetriveItem XMLDatabaseRetriveItem = (OBJS.XMLDatabaseRetriveItem)Prop.GetCustomAttributes(typeof(OBJS.XMLDatabaseRetriveItem), true).FirstOrDefault();

                string DataSetName = (XMLDatabaseRetriveItem.DataSet == string.Empty) ? Prop.Name : XMLDatabaseRetriveItem.DataSet;
                DefaultItemName = (XMLDatabaseRetriveItem.ItemName != string.Empty) ? XMLDatabaseRetriveItem.ItemName : DefaultItemName;

                Type ListType = Prop.PropertyType.GetGenericArguments()[0];
                if (XMLDatabaseRetriveItem.NestedListClassType != null)
                {
                    ListType = XMLDatabaseRetriveItem.NestedListClassType;
                }

                System.Collections.IList IList = (System.Collections.IList)Prop.GetValue(Item, null);
                if (IList != null)
                {
                    foreach (Object ListItem in IList)
                    {
                        OBJS.Data NestedDataSet = BuildData(ListType, ListItem, DataSetName, DefaultItemName);
                        DataSet.SetRetriveValue(NestedDataSet);
                    }
                }
            }
        }
Exemple #3
0
        private static void GetAttributeFillDataSet(Type BaseType, OBJS.Data DataSet)
        {
            List <PropertyInfo> AttributeFillNodes = GetProprites(OBJS.Types.AttributeFill, BaseType);

            foreach (PropertyInfo Prop in AttributeFillNodes)
            {
                OBJS.XMLDatabaseRetriveItem XMLDatabaseRetriveItem = (OBJS.XMLDatabaseRetriveItem)Prop.GetCustomAttributes(typeof(OBJS.XMLDatabaseRetriveItem), true).FirstOrDefault();

                DataSet.SetRetriveValue(XMLDatabaseRetriveItem.NodeName);
            }
        }
Exemple #4
0
        private static void GetNestedMulitNodeDataSet(string DefaultItemName, Type BaseType, OBJS.Data DataSet)
        {
            List <PropertyInfo> NestedMulitNode = GetProprites(OBJS.Types.NestedMulitNode, BaseType);

            foreach (PropertyInfo Prop in NestedMulitNode)
            {
                OBJS.XMLDatabaseRetriveItem XMLDatabaseRetriveItem = (OBJS.XMLDatabaseRetriveItem)Prop.GetCustomAttributes(typeof(OBJS.XMLDatabaseRetriveItem), true).FirstOrDefault();

                string DataSetName = (XMLDatabaseRetriveItem.DataSet == string.Empty) ? Prop.Name : XMLDatabaseRetriveItem.DataSet;
                DefaultItemName = (XMLDatabaseRetriveItem.ItemName != string.Empty) ? XMLDatabaseRetriveItem.ItemName : DefaultItemName;

                Type      ListType      = Prop.PropertyType.GetGenericArguments()[0];
                OBJS.Data NestedDataSet = GetDataSet(DataSetName, DefaultItemName, ListType);
                NestedDataSet.IsSettingsItem = true;
                DataSet.SetRetriveValue(NestedDataSet);
            }
        }
Exemple #5
0
        private static void AddAttributes(Type BaseType, OBJS.Data DataSet)
        {
            List <PropertyInfo> Props = GetProprites(OBJS.Types.Attribute, BaseType);

            List <string> Values = new List <string>();

            foreach (PropertyInfo Prop in Props)
            {
                OBJS.XMLDatabaseRetriveItem XMLDatabaseRetriveItem = (OBJS.XMLDatabaseRetriveItem)Prop.GetCustomAttributes(typeof(OBJS.XMLDatabaseRetriveItem), true).FirstOrDefault();

                if (Values.Contains(XMLDatabaseRetriveItem.NodeName) == false)
                {
                    Values.Add(XMLDatabaseRetriveItem.NodeName);
                }
            }

            foreach (string Value in Values)
            {
                DataSet.SetRetriveValue(Value);
            }
        }
Exemple #6
0
        private static OBJS.Data GetDataSet(string DataSetString, string DefaultItemName, Type BaseType)
        {
            OBJS.Data DataSet = new OBJS.Data();
            DataSet.DataSet         = DataSetString;
            DataSet.DefaultItemName = DefaultItemName;

            List <PropertyInfo> Props = GetProprites(OBJS.Types.Prop, BaseType);

            foreach (PropertyInfo Prop in Props)
            {
                DataSet.SetRetriveValue(Prop.Name);
            }

            AddAttributes(BaseType, DataSet);
            GetNestedSettingsDataSet(DefaultItemName, BaseType, DataSet);
            GetNestedDataSet(DefaultItemName, BaseType, DataSet);
            GetNestedMulitNodeDataSet(DefaultItemName, BaseType, DataSet);
            GetAttributeFillDataSet(BaseType, DataSet);

            return(DataSet);
        }
Exemple #7
0
        private static void GetNestedSettingsDataSet(string DefaultItemName, Type BaseType, OBJS.Data DataSet)
        {
            List <PropertyInfo> NestedSettings = GetProprites(OBJS.Types.NestedSettings, BaseType);

            foreach (PropertyInfo Prop in NestedSettings)
            {
                OBJS.XMLDatabaseRetriveItem XMLDatabaseRetriveItem = (OBJS.XMLDatabaseRetriveItem)Prop.GetCustomAttributes(typeof(OBJS.XMLDatabaseRetriveItem), true).FirstOrDefault();

                string DataSetName = Prop.Name;

                if (XMLDatabaseRetriveItem.DataSet != string.Empty)
                {
                    DataSetName = XMLDatabaseRetriveItem.DataSet;
                }

                Type PropType = Prop.PropertyType;

                OBJS.Data NestedDataSet = GetDataSet(DataSetName, DefaultItemName, PropType);
                NestedDataSet.IsSettingsItem = true;
                DataSet.SetRetriveValue(NestedDataSet);
            }
        }