コード例 #1
0
        private void LoadPropertiesFromXml(XmlNode node)
        {
            foreach (XmlNode selectNode in node.SelectNodes("property"))
            {
                string name = XmlUtils.NeedAttr(selectNode, "name");
                if (this.Properties.Find(name) != null)
                {
                    throw new MetadataException(string.Format("Свойство {0} уже определено.", (object)name));
                }
                MetadataProperty property = new MetadataProperty(this, name, this.Properties.Count);
                property.LoadFromXml(selectNode);
                this.AllProperties.Add(property);
                if (!property.IsExtension)
                {
                    this.Properties.Add(property);
                    switch (property.Purpose)
                    {
                    case MetadataPropertyPurpose.Id:
                        this.FIdProperty = property;
                        break;

                    case MetadataPropertyPurpose.Association:
                    case MetadataPropertyPurpose.Aggregation:
                        MetadataAssociation ass = new MetadataAssociation(property);
                        this.Associations.Add(ass);
                        if (property.Purpose == MetadataPropertyPurpose.Aggregation)
                        {
                            this.Owners.Add(ass);
                            break;
                        }
                        break;
                    }
                }
            }
        }
コード例 #2
0
 public MetadataAssociation Find(string name)
 {
     for (int index = 0; index < this.FItems.Count; ++index)
     {
         MetadataAssociation fitem = this.FItems[index];
         if (fitem.Property.Name == name)
         {
             return(fitem);
         }
     }
     return((MetadataAssociation)null);
 }
コード例 #3
0
 internal void LoadAssociations()
 {
     try
     {
         for (int index = 0; index < this.Associations.Count; ++index)
         {
             MetadataAssociation association = this.Associations[index];
             association.LoadFromXml(association.Property.SourceNode);
         }
     }
     catch (Exception ex)
     {
         throw new MetadataException(string.Format("Ошибка загрузки метаданных класса {0}", (object)this.Name), ex);
     }
 }
コード例 #4
0
 internal void Add(MetadataAssociation ass) => this.FItems.Add(ass);
コード例 #5
0
 internal void SetAssociation(MetadataAssociation ass) => this.FAssociation = ass;
コード例 #6
0
 internal MetadataAssociationRef(MetadataAssociation ass, int index)
 {
     this.Association = ass;
     this.Index       = index;
 }
コード例 #7
0
 internal ExternalLinkNavigator(MetadataAssociation externalAssociation) => this.FExternalAssociation = externalAssociation;