本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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;
}
示例5: AssertNodeIsDummy
private static void AssertNodeIsDummy(TreeNode node)
{
Assert.IsFalse(node is VirtualTreeNode);
Assert.AreEqual("DummyTreeNode", node.GetType().Name, "node isn't DummyTreeNode");
}
示例6: IsParentNode
private static bool IsParentNode(TreeNode target)
{
if (target.GetType().Name == "LiplisTreeNodePar")
{
return true;
}
return false;
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}