示例#1
0
        public void AddMapping(AttributeDefinition mapping)
        {
            if (mapping is EntityAttribute)
            {
                var m = mapping as EntityAttribute;

                //if (!EntityAttributes.Contains(m))
                //{
                //    EntityAttributes.Add(m);
                //}

                foreach (var a in EntityAttributes)
                {
                    if (a.Name.Equals(m.Name) && a.IfcEntityAttribute.Equals(m.IfcEntityAttribute))
                    { return; }
                }
                EntityAttributes.Add(m);
            }
            else if (mapping is BbTypeAttribute)
            {
                var n = mapping as BbTypeAttribute;
                foreach (var s in BbTypeAttributes)
                {
                    if (s.Name.Equals(n.Name))
                    {
                        return;
                    }
                }

                BbTypeAttributes.Add(n);
            }
        }
示例#2
0
 /// <summary>
 /// Create a new AttributeDefinition object.
 /// </summary>
 /// <param name="guid">Initial value of the Guid property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="dataType">Initial value of the DataType property.</param>
 public static AttributeDefinition CreateAttributeDefinition(global::System.Guid guid, global::System.String name, global::System.String dataType)
 {
     AttributeDefinition attributeDefinition = new AttributeDefinition();
     attributeDefinition.Guid = guid;
     attributeDefinition.Name = name;
     attributeDefinition.DataType = dataType;
     return attributeDefinition;
 }