Ejemplo n.º 1
0
        IXamlMember ResolveMember(IXamlType type)
        {
            var rv = type.Fields.FirstOrDefault(f => f.IsPublic && f.IsStatic && f.Name == Member) ??
                     (IXamlMember)type.GetAllProperties().FirstOrDefault(p =>
                                                                         p.Name == Member && p.Getter != null && p.Getter.IsPublic && p.Getter.IsStatic);

            if (rv == null)
            {
                throw new XamlParseException(
                          $"Unable to resolve {Member} as static field, property, constant or enum value", this);
            }
            return(rv);
        }