Exemplo n.º 1
0
        internal static void MemberDetailText(MemberInfo mi)
        {
            GetDesc(mi, "Member");

            String memberType;

            if (mi.MemberType == MemberTypes.TypeInfo)
            {
                memberType = GetTypeKind((Type)mi);
            }
            else
            {
                memberType = mi.MemberType.ToString();
            }

            String memInfo = MemberInfoString(mi, PARENS);

            if (memInfo != null)
            {
                memberType += memInfo;
            }

            ILinkTarget linkTarget = null;

            if (mi.DeclaringType != null)
            {
                TypeLibrary typeLib =
                    TypeLibrary.GetTypeLib(mi.DeclaringType);
                if (typeLib != null)
                {
                    linkTarget = ComLinkHelper.CLHelper;
                }
            }

            // No AX type linkage available, link to the assy/types nodes
            if (linkTarget == null)
            {
                linkTarget = TypeLinkHelper.TLHelper;
            }

            DetailPanel.AddLink(memberType,
                                !ObjectBrowser.INTERNAL,
                                10,
                                linkTarget,
                                mi,
                                HelpLinkHelper.
                                MakeLinkModifier(mi));

            if (mi.DeclaringType != null)
            {
                DetailPanel.AddLink("Member Declaring Type",
                                    !ObjectBrowser.INTERNAL,
                                    61,
                                    TypeLinkHelper.TLHelper,
                                    mi.DeclaringType,
                                    HelpLinkHelper.
                                    MakeLinkModifier(mi.DeclaringType));
            }
        }
Exemplo n.º 2
0
        internal static void GetDetailAxType(Type type,
                                             MemberInfo memberInfo,
                                             String desc,
                                             int position)
        {
            TypeLibrary typeLib = TypeLibrary.GetTypeLib(type);

            if (typeLib != null)
            {
                if (desc == null)
                {
                    desc = "ActiveX Type";
                }
                if (memberInfo is MethodInfo)
                {
                    desc = "Method Return Type (AX)";
                }
                if (position == 0)
                {
                    position = 15;
                }
                DetailPanel.AddLink(desc,
                                    !ObjectBrowser.INTERNAL,
                                    position,
                                    ComLinkHelper.CLHelper,
                                    type,
                                    HelpLinkHelper.
                                    MakeLinkModifier(type));
                DetailPanel.AddLink("Type Library",
                                    !ObjectBrowser.INTERNAL,
                                    180,
                                    ComLinkHelper.CLHelper,
                                    typeLib,
                                    HelpLinkHelper.
                                    MakeLinkModifier(typeLib));
            }
        }
Exemplo n.º 3
0
        internal void GetBasicDetailText()
        {
            // The type library Guid comes from its key
            if (!(this is TypeLibrary) && _guidStr != null)
            {
                DetailPanel.Add(_infoType + " Guid",
                                !ObjectBrowser.INTERNAL,
                                21,
                                _guidStr);
            }

            // Get the CLR type if its available
            _displayedIdentifier = false;
            if (_container is TypeLibrary)
            {
                TypeLibrary typeLib = (TypeLibrary)_container;
                bool        findClass;
                if (this is ComClassInfo)
                {
                    findClass = TypeLibrary.FIND_CLASS;
                }
                else
                {
                    findClass = !TypeLibrary.FIND_CLASS;
                }
                Type type = typeLib.FindTypeByName(_name,
                                                   findClass);
                if (type != null)
                {
                    DetailPanel.AddLink("CLR Type",
                                        !ObjectBrowser.INTERNAL,
                                        15,
                                        TypeLinkHelper.TLHelper,
                                        type,
                                        HelpLinkHelper.
                                        MakeLinkModifier(type));
                    ComObjectInfo.GetDetailAxType(type, null, _infoType, 10);
                    _displayedIdentifier = true;
                }
                else
                {
                    DetailPanel.AddLink("Type Library",
                                        !ObjectBrowser.INTERNAL,
                                        25,
                                        ComLinkHelper.CLHelper,
                                        _container,
                                        HelpLinkHelper.MakeLinkModifier
                                            (_container._helpFile, 0));
                }
            }

            if (_helpFile != null)
            {
                DetailPanel.AddLink("Help File",
                                    !ObjectBrowser.INTERNAL,
                                    225,
                                    HelpLinkHelper.HLHelper,
                                    HelpLinkHelper.MakeLinkModifier
                                        (_helpFile, 0));
                if (_helpContext != 0)
                {
                    DetailPanel.AddLink("Help Context",
                                        !ObjectBrowser.INTERNAL,
                                        227,
                                        HelpLinkHelper.HLHelper,
                                        HelpLinkHelper.MakeLinkModifier
                                            (_helpFile, _helpContext));
                }
            }

            // Type library description is displayed in the type library stuff
            if (DocString != null && !(this is TypeLibrary))
            {
                DetailPanel.Add("Description",
                                !ObjectBrowser.INTERNAL,
                                23,
                                DocString);
            }

            // Show everything in the registry
            if (!(this is TypeLibrary) && _regKey != null)
            {
                try {
                    string[] keys = _regKey.GetSubKeyNames();
                    foreach (String str in keys)
                    {
                        RegistryKey key   = _regKey.OpenSubKey(str);
                        string      value = (string)key.GetValue(null);
                        // If there is no value, see if there are any subkeys
                        if (value == null || value.Equals(""))
                        {
                            String[] subKeys = key.GetSubKeyNames();
                            if (subKeys.Length > 0)
                            {
                                foreach (string subStr in subKeys)
                                {
                                    AddRegistryValue(str, subStr);
                                }
                            }
                            else
                            {
                                AddRegistryValue(str, null);
                            }
                        }
                        else
                        {
                            AddRegistryValue(str, (string)key.GetValue(null));
                        }
                    }
                } catch {
                    // ignore errors
                }
            }
        }