public override PropertyDefinition GetProperty(string name, GetPropertyOptions options)
        {
            // TODO Probably treat as ambiguous
            bool declaredOnly = options.HasFlag(GetPropertyOptions.DeclaredOnly);
            bool attached     = options.HasFlag(GetPropertyOptions.IncludeExtenders);
            var  props        = declaredOnly ? this.Properties : EnumerateProperties();

            return(props.ByLocalName(name, attached).FirstOrDefault());
        }
        public override PropertyDefinition GetProperty(QualifiedName name, GetPropertyOptions options)
        {
            PropertyDefinition result = this.Properties[name];

            if (result != null)
            {
                return(result);
            }

            bool declaredOnly = options.HasFlag(GetPropertyOptions.DeclaredOnly);

            if (declaredOnly)
            {
                return(null);
            }

            // TODO This seems backwards
            var comparer = options.HasFlag(GetPropertyOptions.IncludeExtenders)
                ? Utility.OrdinalIgnoreCaseQualifiedName
                : Utility.AttachedOrdinalIgnoreCaseQualifiedName;

            return(EnumerateProperties().FirstOrDefault(t => comparer.Equals(t.QualifiedName, name)));
        }
 public override PropertyDefinition GetProperty(string name, GetPropertyOptions options)
 {
     // TODO Probably treat as ambiguous
     bool declaredOnly = options.HasFlag(GetPropertyOptions.DeclaredOnly);
     bool attached = options.HasFlag(GetPropertyOptions.IncludeExtenders);
     var props = declaredOnly ? this.Properties : EnumerateProperties();
     return props.ByLocalName(name, attached).FirstOrDefault();
 }
        public override PropertyDefinition GetProperty(QualifiedName name, GetPropertyOptions options)
        {
            PropertyDefinition result = this.Properties[name];
            if (result != null)
                return result;

            bool declaredOnly = options.HasFlag(GetPropertyOptions.DeclaredOnly);
            if (declaredOnly)
                return null;

            var comparer = options.HasFlag(GetPropertyOptions.IncludeExtenders)
                ? Utility.OrdinalIgnoreCaseQualifiedName
                : Utility.AttachedOrdinalIgnoreCaseQualifiedName;
            return EnumerateProperties().FirstOrDefault(t => comparer.Equals(t.QualifiedName, name));
        }
Example #5
0
 public abstract PropertyDefinition GetProperty(string name, GetPropertyOptions options        = GetPropertyOptions.None);
Example #6
0
 public abstract PropertyDefinition GetProperty(QualifiedName name, GetPropertyOptions options = GetPropertyOptions.None);
Example #7
0
 public PropertyDefinition GetProperty(string name, string ns, GetPropertyOptions options = GetPropertyOptions.None)
 {
     return(GetProperty(QualifiedName.Create(ns, name), options));
 }