IfcDoc.Program.ImportCnf C# (CSharp) Méthode

ImportCnf() static private méthode

static private ImportCnf ( IfcDoc cnf, DocProject docProject, DocModelView docView ) : void
cnf IfcDoc
docProject DocProject
docView DocModelView
Résultat void
        internal static void ImportCnf(IfcDoc.Schema.CNF.configuration cnf, DocProject docProject, DocModelView docView)
        {
            Dictionary<string, DocEntity> mapEntity = new Dictionary<string, DocEntity>();
            foreach (DocSection docSection in docProject.Sections)
            {
                foreach (DocSchema docSchema in docSection.Schemas)
                {
                    foreach (DocEntity docEntity in docSchema.Entities)
                    {
                        mapEntity.Add(docEntity.Name, docEntity);
                    }
                }
            }

            foreach (IfcDoc.Schema.CNF.entity ent in cnf.entity)
            {
                DocEntity docEntity = null;
                if (mapEntity.TryGetValue(ent.select, out docEntity))
                {
                    if (ent.attribute != null)
                    {
                        foreach (IfcDoc.Schema.CNF.attribute atr in ent.attribute)
                        {
                            // find attribute on entity
                            foreach (DocAttribute docAttribute in docEntity.Attributes)
                            {
                                if (atr.select != null && atr.select.Equals(docAttribute.Name))
                                {
                                    ImportCnfAttribute(atr.exp_attribute, atr.keep, atr.tagless, docEntity, docAttribute, docView);
                                }
                            }
                        }
                    }

                    if (ent.inverse != null)
                    {
                        foreach (IfcDoc.Schema.CNF.inverse inv in ent.inverse)
                        {
                            // find attribute on entity
                            foreach (DocAttribute docAttribute in docEntity.Attributes)
                            {
                                if (inv.select != null && inv.select.Equals(docAttribute.Name))
                                {
                                    ImportCnfAttribute(inv.exp_attribute, true, Schema.CNF.boolean_or_unspecified.unspecified, docEntity, docAttribute, docView);
                                }
                            }
                        }
                    }

                }
            }
        }