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)); }