예제 #1
0
 // Token: 0x06000A8D RID: 2701 RVA: 0x0002F618 File Offset: 0x0002D818
 public void Add(ConfigurableObjectLogSchema <T, Tschema> .PropertyBase schemaEntry, SimpleProviderPropertyDefinition property)
 {
     schemaEntry.Property = property;
     base.Add(schemaEntry);
 }
예제 #2
0
        // Token: 0x06000A8A RID: 2698 RVA: 0x0002F388 File Offset: 0x0002D588
        private static ConfigurableObjectLogSchema <T, Tschema> .SchemaEntryList ComputeSchemaEntries()
        {
            ConfigurableObjectLogSchema <T, Tschema> .SchemaEntryList schemaEntryList = new ConfigurableObjectLogSchema <T, Tschema> .SchemaEntryList();

            ObjectSchema objectSchema = ObjectSchema.GetInstance <Tschema>();

            foreach (PropertyDefinition propertyDefinition in objectSchema.AllProperties)
            {
                SimpleProviderPropertyDefinition simpleProviderPropertyDefinition = (SimpleProviderPropertyDefinition)propertyDefinition;
                if (simpleProviderPropertyDefinition.IsMultivalued)
                {
                    schemaEntryList.Add(new ConfigurableObjectLogSchema <T, Tschema> .MultiValuedProperty(), simpleProviderPropertyDefinition);
                }
                else
                {
                    Type type = simpleProviderPropertyDefinition.Type;
                    if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable <>))
                    {
                        type = type.GetGenericArguments()[0];
                    }
                    if (type.IsEnum && type.GetCustomAttributes(typeof(FlagsAttribute), true).Length > 0)
                    {
                        schemaEntryList.Add(new ConfigurableObjectLogSchema <T, Tschema> .SimpleProperty <int>(), simpleProviderPropertyDefinition);
                    }
                    else if (type == typeof(ADObjectId))
                    {
                        schemaEntryList.Add(new ConfigurableObjectLogSchema <T, Tschema> .ADObjectIdGuidProperty(), simpleProviderPropertyDefinition);
                        schemaEntryList.Add(new ConfigurableObjectLogSchema <T, Tschema> .StringProperty(), simpleProviderPropertyDefinition);
                    }
                    else if (type == typeof(int))
                    {
                        schemaEntryList.Add(new ConfigurableObjectLogSchema <T, Tschema> .SimpleProperty <int>(), simpleProviderPropertyDefinition);
                    }
                    else if (type == typeof(Unlimited <int>))
                    {
                        schemaEntryList.Add(new ConfigurableObjectLogSchema <T, Tschema> .UnlimitedProperty <int, ConfigurableObjectLogSchema <T, Tschema> .SimpleProperty <int> >(), simpleProviderPropertyDefinition);
                    }
                    else if (type == typeof(byte[]))
                    {
                        schemaEntryList.Add(new ConfigurableObjectLogSchema <T, Tschema> .SimpleProperty <byte[]>(), simpleProviderPropertyDefinition);
                    }
                    else if (type == typeof(Guid))
                    {
                        schemaEntryList.Add(new ConfigurableObjectLogSchema <T, Tschema> .GuidProperty(), simpleProviderPropertyDefinition);
                    }
                    else if (type == typeof(DateTime))
                    {
                        schemaEntryList.Add(new ConfigurableObjectLogSchema <T, Tschema> .DateTimeProperty(), simpleProviderPropertyDefinition);
                    }
                    else if (type == typeof(ExDateTime))
                    {
                        schemaEntryList.Add(new ConfigurableObjectLogSchema <T, Tschema> .ExDateTimeProperty(), simpleProviderPropertyDefinition);
                    }
                    else if (type == typeof(TimeSpan))
                    {
                        schemaEntryList.Add(new ConfigurableObjectLogSchema <T, Tschema> .TimeSpanProperty(), simpleProviderPropertyDefinition);
                    }
                    else if (type == typeof(Unlimited <TimeSpan>))
                    {
                        schemaEntryList.Add(new ConfigurableObjectLogSchema <T, Tschema> .UnlimitedProperty <TimeSpan, ConfigurableObjectLogSchema <T, Tschema> .TimeSpanProperty>(), simpleProviderPropertyDefinition);
                    }
                    else if (type == typeof(EnhancedTimeSpan))
                    {
                        schemaEntryList.Add(new ConfigurableObjectLogSchema <T, Tschema> .EnhancedTimeSpanProperty(), simpleProviderPropertyDefinition);
                    }
                    else if (type == typeof(Unlimited <EnhancedTimeSpan>))
                    {
                        schemaEntryList.Add(new ConfigurableObjectLogSchema <T, Tschema> .UnlimitedProperty <EnhancedTimeSpan, ConfigurableObjectLogSchema <T, Tschema> .EnhancedTimeSpanProperty>(), simpleProviderPropertyDefinition);
                    }
                    else
                    {
                        schemaEntryList.Add(new ConfigurableObjectLogSchema <T, Tschema> .StringProperty(), simpleProviderPropertyDefinition);
                    }
                }
            }
            return(schemaEntryList);
        }