public static MASchemaTypes GetSchema(IManagementAgentParameters config)
        {
            MASchemaTypes types = new MASchemaTypes();

            Assembly assembly = Assembly.GetExecutingAssembly();

            foreach (TypeInfo type in assembly.DefinedTypes)
            {
                if (!type.ImplementedInterfaces.Contains(typeof(ISchemaTypeBuilder)))
                {
                    continue;
                }

                ISchemaTypeBuilder builder = (ISchemaTypeBuilder)Activator.CreateInstance(type);
                foreach (MASchemaType schemaType in builder.GetSchemaTypes(config))
                {
                    if (schemaType != null)
                    {
                        types.Add(schemaType);
                    }
                }
            }

            return(types);
        }
Esempio n. 2
0
        public static ISchemaTypeBuilder <TDerivedSchemaType> OverrideType <TBaseSchemaType, TDerivedSchemaType>(this ISchemaTypeBuilder <TDerivedSchemaType> builder) where TBaseSchemaType : IGraphType where TDerivedSchemaType : TBaseSchemaType, IGraphType
        {
            AbstractTypeFactory <IGraphType> .OverrideType <TBaseSchemaType, TDerivedSchemaType>();

            return(builder);
        }