当前位置: 首页>>代码示例>>C#>>正文


C# TreeNode.GetType方法代码示例

本文整理汇总了C#中System.Windows.Forms.TreeNode.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# TreeNode.GetType方法的具体用法?C# TreeNode.GetType怎么用?C# TreeNode.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.TreeNode的用法示例。


在下文中一共展示了TreeNode.GetType方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildGenericProperties

        private void BuildGenericProperties(TreeNode node)
        {
            string type = node.GetType().Name.Substring(0, node.GetType().Name.Length - 4);

            _type = type + " Properties";

            Property.Property property;
            property = new Property.Property(type + " Name", Name, typeof(string), true);
            _properties.Add(property);
        }
开发者ID:JoeRobich,项目名称:fd-propertiespanel,代码行数:10,代码来源:ProjectItem.cs

示例2: ExportArray

        /// <summary>
        /// for now, this export is pretty stupid. 
        /// It assumes 
        /// * properties are in the same order for each element
        /// * all objects have all properites. 
        /// * we are exporting an array of objects.  Only value properties will be reported, not arrays or other objects etc. 
        /// </summary>
        private void ExportArray(TreeNode arrayNode)
        {
            if (!(arrayNode is ArrayNode)) throw new Exception("Can't export a " + arrayNode.GetType().Name); //should never happen.
            if (arrayNode.Nodes.Count == 0) throw new Exception("Array has 0 elements.");
            if (!(arrayNode.Nodes[0] is ObjectNode)) throw new Exception("Export must be performed on an array of objects.");

            var exportCollection = GetStructuredExport(arrayNode);
            ExportToFile(exportCollection);
        }
开发者ID:mmendelson222,项目名称:json-examiner,代码行数:16,代码来源:Form1.cs

示例3: AddSorted

		public int AddSorted(TreeNode newnode) 
		{
			int insertIndex = -1;
			for (int i = 0; i < this.Nodes.Count; i++)
			{
				TreeNode node = this.Nodes[i];
				if (node.GetType() == newnode.GetType()) 
				{
					if (newnode.Text.CompareTo(node.Text) <= 0) 
					{
						insertIndex = i;
						break;
					}
				}
				else if (newnode is SavedObjectTreeNode) 
				{
					continue;
				}
				else 
				{
					insertIndex = i;
					break;
				}
			}

			if (insertIndex == -1) 
			{
				insertIndex = this.Nodes.Add(newnode);
			}
			else 
			{
				this.Nodes.Insert(insertIndex, newnode);
			}

			return insertIndex;
		}
开发者ID:nguyenhuuhuy,项目名称:mygeneration,代码行数:36,代码来源:ProjectBrowser.cs

示例4: GetDirectoryNode

 private static DirectoryNode GetDirectoryNode(TreeNode treeNode)
 {
     var node = treeNode as DirectoryNode;
     if (node == null)
         throw new Exception(string.Format("huh?? node '{0}' is a '{1}'", treeNode.Text, treeNode.GetType()));
     return node;
 }
开发者ID:mrtgold,项目名称:ImageBrowser,代码行数:7,代码来源:DirectoryTree.cs

示例5: AssertNodeIsDummy

 private static void AssertNodeIsDummy(TreeNode node)
 {
     Assert.IsFalse(node is VirtualTreeNode);
     Assert.AreEqual("DummyTreeNode", node.GetType().Name, "node isn't DummyTreeNode");
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:5,代码来源:VirtualTreeViewTests.cs

示例6: IsParentNode

 private static bool IsParentNode(TreeNode target)
 {
     if (target.GetType().Name == "LiplisTreeNodePar")
     {
         return true;
     }
     return false;
 }
开发者ID:LipliStyle,项目名称:LiplisDoll,代码行数:8,代码来源:ActivityRssRegist.cs

示例7: JsonTreeView_AfterSelectImplementation

        /// <summary>
        /// Default catcher in case of a node of unattended type.
        /// </summary>
        /// <param name="node"></param>
        /// <param name="e"></param>
        // ReSharper disable once UnusedParameter.Local
        private void JsonTreeView_AfterSelectImplementation(TreeNode node, TreeViewEventArgs e)
        {
            newtonsoftJsonTypeTextBox.Text = "";

            jsonTypeComboBox.Text = String.Format("{0}: {1}", JTokenType.Undefined, node.GetType().FullName);

            jsonValueTextBox.ReadOnly = true;
        }
开发者ID:RuxandraOltean,项目名称:JSon-Editor,代码行数:14,代码来源:JsonEditorMainForm.cs

示例8: updateTreeNodeEvents

        public static Hashtable updateTreeNodeEvents(TreeNode control, string elementName, string uniqueId)
        {
            Hashtable controlProperties = new Hashtable();
            string eibCOntrolInterfaceName = (typeof(IEIBControl)).Name;
            if (control.GetType().GetInterface(eibCOntrolInterfaceName) != null)
            {

                IEIBControl eibControl = (IEIBControl)control;
                if (eibControl.OnClickValue != null && !eibControl.OnClickValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeOnClickElt, eibControl.OnClickValue);
                }
                if (eibControl.OnDoubleClick != null && !eibControl.OnDoubleClick.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeOnDoubleClickElt, eibControl.OnDoubleClick);
                }
                if (eibControl.EnteringValue != null && !eibControl.EnteringValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeEnteringElt, eibControl.EnteringValue);
                }
                if (eibControl.ExitingValue != null && !eibControl.ExitingValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeExitingElt, eibControl.ExitingValue);
                }
                if (eibControl.DefaultValue != null && !eibControl.DefaultValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeDefaultValueElt, eibControl.DefaultValue);
                }
            }
            //EIBControl Settings
            return controlProperties;
        }
开发者ID:harpreetoxyent,项目名称:pnl,代码行数:32,代码来源:EIBXMLServices.cs

示例9: updateTreeNodeEvents

        public static Hashtable updateTreeNodeEvents(TreeNode control, string elementName, string uniqueId)
        {
            Hashtable controlProperties = new Hashtable();
            string eibCOntrolInterfaceName = (typeof(IEIBControl)).Name;
            if (control.GetType().GetInterface(eibCOntrolInterfaceName) != null)
            {

                IEIBControl eibControl = (IEIBControl)control;
                if (eibControl.OnClickValue != null && !eibControl.OnClickValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeOnClickElt, eibControl.OnClickValue);
                }
                if (eibControl.OnDoubleClick != null && !eibControl.OnDoubleClick.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeOnDoubleClickElt, eibControl.OnDoubleClick);
                }
                if (eibControl.EnteringValue != null && !eibControl.EnteringValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeEnteringElt, eibControl.EnteringValue);
                }
                if (eibControl.ExitingValue != null && !eibControl.ExitingValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeExitingElt, eibControl.ExitingValue);
                }
                if (eibControl.DefaultValue != null && !eibControl.DefaultValue.Trim().Equals(""))
                {
                    controlProperties.Add(XMLServicesConstants.XmlNodeDefaultValueElt, eibControl.DefaultValue);
                }
                if (eibControl is EIBPanel)
                {
                    if (((EIBPanel)eibControl).GlobalScripts != null && !((EIBPanel)eibControl).GlobalScripts.Trim().Equals(""))
                    {
                        controlProperties.Add(XMLServicesConstants.XmlNodeGlobalScriptsElt, ((EIBPanel)eibControl).GlobalScripts);
                    }
                }
                if (eibControl is EIBTreeNode)
                {
                    if (((EIBTreeNode)eibControl).OnOpen != null && !((EIBTreeNode)eibControl).OnOpen.Trim().Equals(""))
                    {
                        controlProperties.Add(XMLServicesConstants.XmlNodeOnOpenElt, ((EIBTreeNode)eibControl).OnOpen);
                    }
                }
                if (eibControl is EIBTreeView)
                {
                    if (((EIBTreeView)eibControl).OnSelect != null && !((EIBTreeView)eibControl).OnSelect.Trim().Equals(""))
                    {
                        controlProperties.Add(XMLServicesConstants.XmlNodeOnSelectElt, ((EIBTreeView)eibControl).OnSelect);
                    }
                }

            }
            //EIBControl Settings
            return controlProperties;
        }
开发者ID:harpreetoxyent,项目名称:pnl,代码行数:54,代码来源:XMLServices.cs

示例10: WndProc

        /*
        protected override void WndProc(ref Message m)
        {
            try
            {
                base.WndProc(ref m);
            }
            catch (System.Exception e)
            {
                Helper.AddLog(e.Message);
            }
        }
         * */

        #region 两个接口函数

        public Type lt_GetType(string name)
        {
            if (name == "TreeNode")
            {
                TreeNode tn = new TreeNode();
                return tn.GetType();
            }
            if (name == "GridItem")
            {
                PropertyGrid pg = new PropertyGrid();
                pg.SelectedObject = 0;
                return pg.SelectedGridItem.GetType();
            }
            return (Type.GetType(name));
        }
开发者ID:viticm,项目名称:pap2,代码行数:31,代码来源:ScriptCodeForm.cs


注:本文中的System.Windows.Forms.TreeNode.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。