本文整理汇总了C#中System.Windows.Forms.TreeView.sort方法的典型用法代码示例。如果您正苦于以下问题:C# TreeView.sort方法的具体用法?C# TreeView.sort怎么用?C# TreeView.sort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TreeView
的用法示例。
在下文中一共展示了TreeView.sort方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: buildGui
public void buildGui()
{
try
{
var topPanel = this.add_Panel();
//serializedString = topPanel.insert_Right(200).add_GroupBox("Serialized Object").add_SourceCodeViewer();
//var serializedStringPanel = serializedString.splitContainer().panel2Collapsed(true);
propertyGrid = topPanel.add_GroupBox("").add_PropertyGrid().helpVisible(false);
treeView = propertyGrid.parent().insert_Left<Panel>().add_TreeView().sort();
//treeView.splitterDistance(300);
var toStringValue = propertyGrid.parent().insert_Below<Panel>(100).add_GroupBox("ToString Value (not editable):").add_TextArea();
var optionsPanel = treeView.insert_Below<Panel>(70);
var objectName = toStringValue.parent().insert_Above<Panel>(20).add_TextBox("name", "");
//propertyGrid.onValueChange(updateSerializedString);
//setSerializedStringSyncWithPropertyGrid();
//serializedString.insert_Above(20).add_Link("Sync Serialized String With PropertyGrid", 0, 0, () => updateSerializedStringSyncWithPropertyGrid());
LinkLabel invokeLink = null;
invokeLink = optionsPanel.add_CheckBox("Show Methods", 0, 0,
(value) =>
{
ShowMethods = value;
invokeLink.enabled(value);
refresh();
})
.append_Link("invoke", invokeSelectedMethod)
.leftAdd(-16).topAdd(5).bringToFront()
.enabled(false);
optionsPanel.add_CheckBox("Show Property and Field info", 22, 0,
(value) =>
{
ShowPropertyAndFieldInfo = value;
refresh();
})
.autoSize()
.append_Link("refresh", () => refresh())
.left(200);
optionsPanel.add_CheckBox("Sort Values", 0, 135,
(value) =>
{
Sorted = value;
try
{
treeView.sort(Sorted); // throwing "Unable to cast object of type 'System.Boolean' to type 'System.Windows.Forms.TreeView'"
}
catch//(Exception ex)
{
//ex.log();
}
})[email protected](true);
simpleView_CheckBox = optionsPanel.add_CheckBox("Simple View", 0, 220,
(value) =>
{
SimpleView = value;
//propertyGrid.splitContainer().panel1Collapsed(value);
refresh();
})
.bringToFront();
/*showSerializedString_CheckBox = optionsPanel.add_CheckBox("Show serialized string", 44, 0,
(value) =>
{
ShowSerializedString = value;
serializedStringPanel.panel2Collapsed(!value);
refresh();
})
.autoSize();*/
createObjectWhenNull_CheckBox = optionsPanel.add_CheckBox("Create Object When Null", 44, 150,
(value) =>
{
CreateObjectWhenNull = value;
})
.bringToFront()
.autoSize();
treeView.afterSelect<object>(
(selectedObject) =>
{
var treeNode = treeView.selected();
objectName.set_Text(treeNode.get_Text());
var tag = WinForms_ExtensionMethods_TreeView.get_Tag(treeNode);
if (tag.notNull())// && tag.str() != treeNode.get_Text())
{
propertyGrid.show(selectedObject);
var toString = selectedObject.str();
if (toString == "System.__ComObject")
toString += " : {0}".format(selectedObject.comObject_TypeName());
toStringValue.set_Text(toString);
propertyGrid.parent().set_Text(selectedObject.typeFullName());
if (treeNode.nodes().size() == 0)
{
addObjectPropertyAndFields(treeNode, selectedObject);
}
}
//.........这里部分代码省略.........