Пример #1
0
        internal void Build()
        {
            var typeDeclMap = new Dictionary <string, CimTypeDeclaration>();

            foreach (var c in _cimSession.EnumerateClasses(_cimNamespace))
            {
                var typeDecl = new CimTypeDeclaration(c);
                typeDeclMap.Add(typeDecl.Name, typeDecl);
            }

            var toRemove = new List <string>();

            foreach (var kvp in typeDeclMap)
            {
                if (kvp.Value.IsAssociation)
                {
                    if (!kvp.Value.IsAbstract)
                    {
                        try
                        {
                            var associationBuilder = new AssociationBuilder(_options, kvp.Value, typeDeclMap);
                            associationBuilder.Build();
                        }
                        catch (Exception ex)
                        {
                            _options.Error.WriteLine(ex.Message);
                        }
                    }
                }

                var classBuilder = new ClassBuilder(_options, kvp.Value, typeDeclMap);
                classBuilder.Build();
            }
            foreach (var r in toRemove)
            {
                typeDeclMap.Remove(r);
            }
            BuildFactoryClass(typeDeclMap);
            BuildSimCimScopeExtensions(typeDeclMap);
        }