public static string GetTestDescription(this ITypeMember member) { var attr = member.FindAttribute(Attrs.Description); if (attr == null) { return(null); } return(attr.Arguments[0].Value as string); }
private static QName GetName(ITypeMember member) { string name; string ns = ""; var nskind = AbcConstKind.PackageNamespace; var type = member as IType; var attr = member.FindAttribute(Attrs.QName); if (attr == null) { if (type != null) { ns = type.Namespace; } var method = member as IMethod; if (method != null && (method.IsGetter() || method.IsSetter())) { name = member.Name.Substring(4); } else { name = member.Name; } } else { int n = attr.Arguments.Count; if (n == 0) { throw new InvalidOperationException("Invalid qname attribute"); } name = (string)attr.Arguments[0].Value; if (n > 1) { ns = (string)attr.Arguments[1].Value; string kind = (string)attr.Arguments[2].Value; nskind = AbcNamespace.FromShortNsKind(kind); } } return(new QName { Name = name, Namespace = ns, NamespaceKind = nskind }); }