示例#1
0
 public override bool MetaProperty_ConformsTo(MetaPropertyBuilder _this, MetaPropertyBuilder property)
 {
     if (property == null)
     {
         return(false);
     }
     if (_this.Name != property.Name)
     {
         return(false);
     }
     if (!_this.Class.ConformsTo(property.Class))
     {
         return(false);
     }
     if (_this.IsContainment && !property.IsContainment)
     {
         return(false);
     }
     if (!_this.Type.ConformsTo(property.Type) && !property.Type.ConformsTo(_this.Type))
     {
         return(false);
     }
     if (_this.Type is MetaCollectionTypeBuilder && !(property.Type is MetaCollectionTypeBuilder))
     {
         return(false);
     }
     return(true);
 }
示例#2
0
        public override IReadOnlyList <MetaPropertyBuilder> MetaClass_GetAllFinalProperties(MetaClassBuilder _this)
        {
            var props  = _this.GetAllProperties();
            var result = new List <MetaPropertyBuilder>(props);

            result.Reverse();
            int i = result.Count - 1;

            while (i >= 0)
            {
                var currentProp          = result[i];
                MetaPropertyBuilder prop = result.First(p => p.Name == currentProp.Name);
                if (prop != currentProp)
                {
                    result.RemoveAt(i);
                }
                --i;
            }
            return(result);
        }