GetCategoryName() public static method

public static GetCategoryName ( System.Guid catid ) : string
catid System.Guid
return string
Esempio n. 1
0
 internal COMCategory(COMRegistry registry, Guid catid, IEnumerable <Guid> clsids)
     : this(registry)
 {
     CategoryID = catid;
     Clsids     = clsids.ToArray();
     Name       = COMUtilities.GetCategoryName(catid);
 }
        private void SetupClsidEntry(COMCLSIDEntry entry)
        {
            textBoxClsidName.Text  = entry.Name;
            textBoxClsid.Text      = entry.Clsid.ToString("B");
            lblServerType.Text     = "Server Type: " + entry.ServerType;
            lblThreadingModel.Text = "Threading Model: " + entry.ThreadingModel;
            textBoxServer.Text     = entry.Server;
            var progids = _registry.Progids;

            foreach (string progid in entry.ProgIDs)
            {
                ListViewItem item = listViewProgIDs.Items.Add(progid);
                if (progids.ContainsKey(progid))
                {
                    item.Tag = progids[progid];
                }
            }
            listViewProgIDs.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);

            foreach (Guid catid in entry.Categories)
            {
                ListViewItem item = listViewCategories.Items.Add(COMUtilities.GetCategoryName(catid));
                item.Tag = catid;
            }
            listViewCategories.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);

            LoadInterfaceList(entry.Interfaces, listViewInterfaces);
            LoadInterfaceList(entry.FactoryInterfaces, listViewFactoryInterfaces);
            tabPageSupportedInterfaces.Tag = entry;

            tabControlProperties.TabPages.Add(tabPageClsid);
            tabControlProperties.TabPages.Add(tabPageSupportedInterfaces);
            if (_registry.AppIDs.ContainsKey(entry.AppID))
            {
                SetupAppIdEntry(_registry.AppIDs[entry.AppID]);
            }
        }
        private void LoadImplementedCategories()
        {
            int i = 0;
            Dictionary <Guid, List <COMCLSIDEntry> > dict        = m_reg.ImplementedCategories;
            SortedDictionary <string, TreeNode>      sortedNodes = new SortedDictionary <string, TreeNode>();

            foreach (KeyValuePair <Guid, List <COMCLSIDEntry> > pair in dict)
            {
                TreeNode currNode = new TreeNode(COMUtilities.GetCategoryName(pair.Key));
                currNode.Tag         = pair.Key;
                currNode.ToolTipText = String.Format("CATID: {0}", pair.Key.ToString("B"));
                sortedNodes.Add(currNode.Text, currNode);

                TreeNode[]      clsidNodes = new TreeNode[pair.Value.Count];
                COMCLSIDEntry[] entries    = pair.Value.ToArray();
                Array.Sort(entries);
                i = 0;
                foreach (COMCLSIDEntry ent in entries)
                {
                    clsidNodes[i] = CreateClsidNode(ent);
                    i++;
                }
                currNode.Nodes.AddRange(clsidNodes);
            }


            TreeNode[] catNodes = new TreeNode[sortedNodes.Count];
            i = 0;
            foreach (KeyValuePair <string, TreeNode> pair in sortedNodes)
            {
                catNodes[i++] = pair.Value;
            }

            treeComRegistry.Nodes.AddRange(catNodes);
            Text = "Implemented Categories";
        }
Esempio n. 4
0
        private void SetupClsidEntry(COMCLSIDEntry entry)
        {
            textBoxClsidName.Text      = entry.Name;
            textBoxClsid.Text          = entry.Clsid.FormatGuid();
            textBoxServerType.Text     = entry.DefaultServerType.ToString();
            textBoxThreadingModel.Text = entry.DefaultThreadingModel.ToString();
            textBoxServer.Text         = entry.DefaultServer;
            textBoxCmdLine.Text        = GetStringValue(entry.DefaultCmdLine);
            textBoxTreatAs.Text        = GetGuidValue(entry.TreatAs);
            btnTreatAsProps.Enabled    = m_registry.Clsids.ContainsKey(entry.TreatAs);
            var progids = m_registry.Progids;

            foreach (string progid in m_registry.GetProgIdsForClsid(entry.Clsid).Select(p => p.ProgID))
            {
                ListViewItem item = listViewProgIDs.Items.Add(progid);
                if (progids.ContainsKey(progid))
                {
                    item.Tag = progids[progid];
                }
            }
            listViewProgIDs.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);

            foreach (Guid catid in entry.Categories)
            {
                ListViewItem item = listViewCategories.Items.Add(COMUtilities.GetCategoryName(catid));
                item.Tag = catid;
            }
            listViewCategories.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);

            LoadInterfaceList(entry.Interfaces, listViewInterfaces);
            LoadInterfaceList(entry.FactoryInterfaces, listViewFactoryInterfaces);
            tabPageSupportedInterfaces.Tag = entry;

            tabControlProperties.TabPages.Add(tabPageClsid);
            tabControlProperties.TabPages.Add(tabPageSupportedInterfaces);
            if (m_registry.AppIDs.ContainsKey(entry.AppID))
            {
                SetupAppIdEntry(m_registry.AppIDs[entry.AppID]);
            }

            IEnumerable <COMInterfaceEntry> proxies = m_registry.GetProxiesForClsid(entry);

            if (proxies.Any())
            {
                foreach (COMInterfaceEntry intf in proxies.OrderBy(i => i.Name))
                {
                    ListViewItem item = listViewProxies.Items.Add(intf.Name);
                    item.SubItems.Add(intf.Iid.FormatGuid());
                    item.Tag = intf;
                }
                listViewProxies.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
                listViewProxies.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
                listViewProxies.ListViewItemSorter = new ListItemComparer(0);
                tabControlProperties.TabPages.Add(tabPageProxies);
            }

            if (entry.Servers.Count > 1)
            {
                foreach (COMCLSIDServerEntry server in entry.Servers.Values)
                {
                    ListViewItem item = listViewCLSIDServers.Items.Add(server.ServerType.ToString());
                    item.SubItems.Add(server.Server);
                    item.SubItems.Add(server.CommandLine);
                    item.SubItems.Add(server.ThreadingModel.ToString());
                    item.Tag = server;
                }

                listViewCLSIDServers.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
                listViewCLSIDServers.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
                listViewCLSIDServers.ListViewItemSorter = new ListItemComparer(0);
                tabControlProperties.TabPages.Add(tabPageServers);
            }

            SetupTypeLibVersionEntry(m_registry.GetTypeLibVersionEntry(entry.TypeLib, null));

            if (entry.Elevation != null)
            {
                textBoxElevationEnabled.Text       = entry.Elevation.Enabled.ToString();
                textBoxElevationAutoApproval.Text  = entry.Elevation.AutoApproval.ToString();
                textBoxElevationIconReference.Text = GetStringValue(entry.Elevation.IconReference);
                foreach (COMCLSIDEntry vso in entry.Elevation.VirtualServerObjects.Select(v => m_registry.MapClsidToEntry(v)))
                {
                    ListViewItem item = listViewElevationVSOs.Items.Add(vso.Name);
                    item.SubItems.Add(vso.Clsid.ToString());
                    item.SubItems.Add(vso.CanElevate.ToString());
                    item.SubItems.Add(vso.AutoElevation.ToString());
                    item.Tag = vso;
                }
                listViewElevationVSOs.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
                listViewElevationVSOs.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
                listViewElevationVSOs.ListViewItemSorter = new ListItemComparer(0);
                tabControlProperties.TabPages.Add(tabPageElevation);
            }

            if (entry.Servers.ContainsKey(COMServerType.InProcServer32) && entry.Servers[COMServerType.InProcServer32].HasDotNet)
            {
                COMCLSIDServerDotNetEntry dotnet = entry.Servers[COMServerType.InProcServer32].DotNet;
                textBoxDotNetAssemblyName.Text   = dotnet.AssemblyName;
                textBoxDotNetClassName.Text      = dotnet.ClassName;
                textBoxDotNetCodeBase.Text       = dotnet.CodeBase;
                textBoxDotNetRuntimeVersion.Text = dotnet.RuntimeVersion;
                tabControlProperties.TabPages.Add(tabPageDotNet);
            }

            m_clsid = entry;
        }
Esempio n. 5
0
 public COMCategory(Guid catid, IEnumerable <Guid> clsids)
 {
     CategoryID = catid;
     Clsids     = clsids.ToArray();
     Name       = COMUtilities.GetCategoryName(catid);
 }