Exemplo n.º 1
0
        private void SetImageIndex(ComTypeTreeNode comTypeTreeNode)
        {
            ComTypeLibraryTreeNode  comTypeLibraryTreeNode  = comTypeTreeNode as ComTypeLibraryTreeNode;
            ComTypeInfoTreeNode     comTypeInfoTreeNode     = comTypeTreeNode as ComTypeInfoTreeNode;
            ComFunctionInfoTreeNode comFunctionInfoTreeNode = comTypeTreeNode as ComFunctionInfoTreeNode;
            ComPropertyInfoTreeNode comPropertyInfoTreeNode = comTypeTreeNode as ComPropertyInfoTreeNode;
            ComVariableInfoTreeNode comVariableInfoTreeNode = comTypeTreeNode as ComVariableInfoTreeNode;

            if (comTypeLibraryTreeNode != null)
            {
                comTypeTreeNode.ImageIndex = ComTypeNodeNamespaceImageIndex;
            }
            else if (comTypeInfoTreeNode != null)
            {
                ComTypeInfo comTypeInfo = comTypeInfoTreeNode.ComTypeInfo;

                if (comTypeInfo.IsCoClass)
                {
                    comTypeTreeNode.ImageIndex = ComTypeNodeClassImageIndex;
                }
                else if (comTypeInfo.IsDispatch)
                {
                    comTypeTreeNode.ImageIndex = ComTypeNodeInterfaceImageIndex;
                }
                else if (comTypeInfo.IsInterface)
                {
                    comTypeTreeNode.ImageIndex = ComTypeNodeInterfaceImageIndex;
                }
                else if (comTypeInfo.IsEnum)
                {
                    comTypeTreeNode.ImageIndex = ComTypeNodeEnumImageIndex;
                }
                else if (comTypeInfo.IsAlias)
                {
                    comTypeTreeNode.ImageIndex = ComTypeNodeAliasImageIndex;
                }
                else if (comTypeInfo.IsRecord)
                {
                    comTypeTreeNode.ImageIndex = ComTypeNodeStructureImageIndex;
                }
            }
            else if (comFunctionInfoTreeNode != null)
            {
                comTypeTreeNode.ImageIndex = ComTypeNodeMethodImageIndex;
            }
            else if (comPropertyInfoTreeNode != null)
            {
                comTypeTreeNode.ImageIndex = ComTypeNodePropertyImageIndex;
            }
            else if (comVariableInfoTreeNode != null)
            {
                comVariableInfoTreeNode.ImageIndex = ComTypeNodeConstantImageIndex;
            }

            comTypeTreeNode.SelectedImageIndex = comTypeTreeNode.ImageIndex;
        }
Exemplo n.º 2
0
        private void comTypeTreeView_AfterSelect(object sender, TreeViewEventArgs e)
        {
            _navigationController.Remove(comTypeListView.Items.OfType <ListViewItem>().ToArray());
            _navigationController.CurrentItem = e.Node;

            ComTypeLibraryTreeNode  comTypeLibraryTreeNode  = e.Node as ComTypeLibraryTreeNode;
            ComTypeInfoTreeNode     comTypeInfoTreeNode     = e.Node as ComTypeInfoTreeNode;
            ComFunctionInfoTreeNode comFunctionInfoTreeNode = e.Node as ComFunctionInfoTreeNode;
            ComPropertyInfoTreeNode comPropertyInfoTreeNode = e.Node as ComPropertyInfoTreeNode;
            ComVariableInfoTreeNode comVariableInfoTreeNode = e.Node as ComVariableInfoTreeNode;

            comTypeListView.SelectedComTypeInfo = null;

            if (comTypeLibraryTreeNode != null)
            {
                typeInfoRichTextBox.DescribeComTypeLibrary(comTypeLibraryTreeNode.ComTypeLibrary);
            }
            else if (comTypeInfoTreeNode != null)
            {
                ComTypeInfo comTypeInfo = comTypeInfoTreeNode.ComTypeInfo;
                comTypeListView.SelectedComTypeInfo = comTypeInfo;
                typeInfoRichTextBox.DescribeComTypeInfo(comTypeInfo);
            }
            else if (comFunctionInfoTreeNode != null)
            {
                typeInfoRichTextBox.DescribeComFunctionInfo(comFunctionInfoTreeNode.ComFunctionInfo);
            }
            else if (comPropertyInfoTreeNode != null)
            {
                typeInfoRichTextBox.DescribeComPropertyInfo(comPropertyInfoTreeNode.ComPropertyInfo);
            }
            else if (comVariableInfoTreeNode != null)
            {
                typeInfoRichTextBox.DescribeComVariableInfo(comVariableInfoTreeNode.ComVariableInfo);
            }
        }