示例#1
0
        // Takes a documentation signature (not including the documentation member type prefix) and resolves it to a type
        // in the assembly.
        public static TypeDesc GetTypeByDocumentationSignature(IAssemblyDesc assembly, string signature)
        {
            int index   = 0;
            var results = new List <TypeSystemEntity>();

            DocumentationSignatureParser.ParseSignaturePart(signature, ref index, (ModuleDesc)assembly, DocumentationSignatureParser.MemberType.Type, results);
            Debug.Assert(results.Count <= 1);
            return(results.Count == 0 ? null : (TypeDesc)results[0]);
        }
示例#2
0
        // Takes a member signature (not including the declaring type) and returns the matching members on the type.
        public static IEnumerable <TypeSystemEntity> GetMembersByDocumentationSignature(MetadataType type, string signature, bool acceptName = false)
        {
            int index       = 0;
            var results     = new List <TypeSystemEntity>();
            var nameBuilder = new StringBuilder();

            var(name, arity) = DocumentationSignatureParser.ParseTypeOrNamespaceName(signature, ref index, nameBuilder);
            DocumentationSignatureParser.GetMatchingMembers(signature, ref index, type.Module, type, name, arity, DocumentationSignatureParser.MemberType.All, results, acceptName);
            return(results);
        }