示例#1
0
        private static int CompareMemberNames(MemberDesc a, MemberDesc b)
        {
            // Compare the names with case-insensitive comparison first (for ordering purposes)

            string nameA = a.Name;
            string nameB = b.Name;

            int result = string.Compare(nameA, nameB, true);

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

            // Now try case-sensitive comparison

            result = string.Compare(nameA, nameB, false);
            if (result != 0)
            {
                return(result);
            }

            // Names are the same - must be methods or properties with different signatures

            Debug.Assert(a.MemberType == MemberTypes.Method || a.MemberType == MemberTypes.Property,
                         "a.MemberType == MemberTypes.Method || a.MemberType == MemberTypes.Property");
            return(string.Compare(a.ToString(), b.ToString(), true));
        }
示例#2
0
        internal ComMemberBrowserInfo(ComTypeBrowserInfo type, MemberDesc member, string nodeText)
        {
            Debug.Assert(type != null && nodeText != null,
                         "type != null && && nodeText != null");

            m_type     = type;
            m_member   = member;
            m_nodeText = nodeText;
        }
示例#3
0
        private static int GetMemberTypePriority(MemberDesc member)
        {
            // Order of priority: method, property, field, event.

            switch (member.MemberType)
            {
            case MemberTypes.Method:
                return(1);

            case MemberTypes.Property:
                return(2);

            case MemberTypes.Field:
                return(3);

            case MemberTypes.Event:
                return(4);

            default:
                Debug.Fail("Unsupported member type: '" + member.MemberType.ToString() + "'.");
                return(0);
            }
        }