本文整理汇总了C#中System.Windows.Forms.TreeView.ExpandAll方法的典型用法代码示例。如果您正苦于以下问题:C# TreeView.ExpandAll方法的具体用法?C# TreeView.ExpandAll怎么用?C# TreeView.ExpandAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TreeView
的用法示例。
在下文中一共展示了TreeView.ExpandAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FCM
/// <summary>
/// Populate an FCE Ultra movie file's header information
/// </summary>
public static void FCM(ref TreeView tv, ref TASMovie fcm)
{
FCEU movie = (FCEU)fcm;
tv.Nodes.Clear();
tv.Nodes.Add("Header");
tv.Nodes[0].Nodes.Add("Signature: " + movie.Header.Signature);
tv.Nodes[0].Nodes.Add("Version: " + movie.Header.Version.ToString());
tv.Nodes[0].Nodes.Add("Frame Count: " + String.Format("{0:0,0}", movie.Header.FrameCount));
tv.Nodes[0].Nodes.Add("Rerecord Count: " + String.Format("{0:0,0}", movie.Header.RerecordCount));
tv.Nodes[0].Nodes.Add("Emulator Version: " + movie.Header.EmulatorID);
tv.Nodes[0].Nodes.Add("Movie Start: " + movie.Options.MovieStart);
tv.Nodes[0].Nodes.Add("Movie Timing: " + movie.Options.MovieTiming);
tv.Nodes.Add("Metadata");
tv.Nodes[1].Nodes.Add("Author: " + movie.Extra.Author);
tv.Nodes.Add("ROM Information");
tv.Nodes[2].Nodes.Add("ROM Title: " + movie.Extra.ROM);
tv.Nodes[2].Nodes.Add("ROM CRC: " + movie.Extra.CRC);
tv.Nodes.Add("Controllers");
tv.Nodes[3].Nodes.Add("Controller 1: " + movie.Input.Controllers[0].ToString());
tv.Nodes[3].Nodes.Add("Controller 2: " + movie.Input.Controllers[1].ToString());
tv.Nodes[3].Nodes.Add("Controller 3: " + movie.Input.Controllers[2].ToString());
tv.Nodes[3].Nodes.Add("Controller 4: " + movie.Input.Controllers[3].ToString());
movie = null; tv.ExpandAll(); tv.Nodes[0].EnsureVisible();
}
示例2: getTreeViewByPathDir
/// <summary>
///
/// </summary>
/// <param name="tv"></param>
/// <param name="dtDocList"></param>
public void getTreeViewByPathDir(TreeView tv)
{
HYDocumentMS.IFileHelper filehelper = new HYDocumentMS.FileHelper();
dtDirList = filehelper.getDocFileDir(true);//获取文档目录的清单
CreatTree(tv.Nodes, "0", dtDirList);
tv.ExpandAll();
}
示例3: Bind
public void Bind(MapperGenerator.Library.Model.TemplateSource.FileModel model, Dictionary<TreeNode, object> templateFileModelMap, TreeView treeFileTemplateModel)
{
treeFileTemplateModel.Nodes.Clear();
templateFileModelMap.Clear();
var fileNode = new TreeNode("File");
templateFileModelMap.Add(fileNode, model);
foreach (var ns in model.Namespaces)
{
var nsNode = new TreeNode(ns.Name.PascalCase);
templateFileModelMap.Add(nsNode, ns);
foreach (var cs in ns.Entities)
{
var csNode = new TreeNode(cs.Name.PascalCase);
templateFileModelMap.Add(csNode, cs);
foreach (var ps in cs.Properties)
{
var psNode = new TreeNode(ps.Name.PascalCase);
templateFileModelMap.Add(psNode, ps);
csNode.Nodes.Add(psNode);
}
nsNode.Nodes.Add(csNode);
}
fileNode.Nodes.Add(nsNode);
}
treeFileTemplateModel.Nodes.Add(fileNode);
treeFileTemplateModel.SelectedNode = fileNode;
treeFileTemplateModel.ExpandAll();
}
示例4: EditHighlightingDialog
public EditHighlightingDialog(TreeNode topNode)
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.EditDialog.xfrm"));
acceptBtn = (Button)ControlDictionary["acceptBtn"];
nodeTree = (TreeView)ControlDictionary["nodeTree"];
propPanel = (Panel)ControlDictionary["propPanel"];
optionPanel = (Panel)ControlDictionary["optionPanel"];
// Form editor does not work properly with the custom control
this.gradientLabel.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
this.gradientLabel.BorderStyle = BorderStyle.Fixed3D;
this.gradientLabel.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.gradientLabel.Location = new System.Drawing.Point(0, 0);
this.gradientLabel.Size = new System.Drawing.Size(propPanel.Width, 30);
this.gradientLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.propPanel.Controls.Add(gradientLabel);
this.bottomLabel.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
this.bottomLabel.BorderStyle = BorderStyle.Fixed3D;
this.bottomLabel.Location = new System.Drawing.Point(0, propPanel.Height - 2);
this.bottomLabel.Size = new System.Drawing.Size(propPanel.Width, 2);
this.propPanel.Controls.Add(bottomLabel);
this.ClientSize = new Size(660, 530);
this.acceptBtn.Click += new EventHandler(acceptClick);
ControlDictionary["cancelBtn"].Click += new EventHandler(cancelClick);
this.nodeTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.NodeTreeAfterSelect);
this.nodeTree.BeforeSelect += new System.Windows.Forms.TreeViewCancelEventHandler(this.NodeTreeBeforeSelect);
nodeTree.Nodes.Add(topNode);
nodeTree.ExpandAll();
nodeTree.SelectedNode = topNode;
}
示例5: Show
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
{
try
{
var obj = objectProvider.GetData();
var modelNode = new M2ModelDialogDebuggerVisualizerService().DeserializeDataFromStream<ModelNode>(obj);
var form = new Form
{
ClientSize = new Size(800, 600),
FormBorderStyle = FormBorderStyle.FixedToolWindow,
};
var treeView = new TreeView();
treeView.Parent = form;
treeView.Dock = DockStyle.Fill;
InitNodes(treeView.Nodes, modelNode);
treeView.ExpandAll();
windowService.ShowDialog(form);
}
catch (Exception e)
{
// TODO
throw;
}
}
示例6: EditValue
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
editorService = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
if (editorService == null)
return value;
FmodEventShape Shape = context.Instance as FmodEventShape;
System.Diagnostics.Debug.Assert(Shape != null, "EventGroupSelectionEditor only valid for FmodEventShapes!");
// Create a TreeView and populate it
treeView = new TreeView();
treeView.ImageList = EditorManager.GUI.ShapeTreeImages.ImageList;
treeView.Bounds = new Rectangle(0, 0, 400, 500);
treeView.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView_NodeMouseClick);
FmodManaged.ManagedModule.GetEventGroupTree(Shape.EventProject, treeView);
treeView.ExpandAll();
// Show our listbox as a DropDownControl.
// This methods returns, when the DropDownControl is closed.
editorService.DropDownControl(treeView);
TreeNode selectedNode = treeView.SelectedNode;
if (selectedNode != null)
{
string fullPath = selectedNode.FullPath;
return fullPath.Replace("\\", "/");
}
else
return Shape.EventGroup;
}
示例7: Fill
public static void Fill(this ISnmpMessage message, TreeView tree)
{
var messageNode = tree.Nodes.Add(string.Format("Version {0}", message.Version));
if (message.Version == VersionCode.V3)
{
var header = messageNode.Nodes.Add("header");
header.Nodes.Add(string.Format("message id {0}", message.Header.MessageId));
header.Nodes.Add(string.Format("max size {0}", message.Header.MaxSize));
header.Nodes.Add(string.Format("security level {0}", message.Header.SecurityLevel.GetString()));
}
var parameter = messageNode.Nodes.Add("parameters");
if (message.Version == VersionCode.V3)
{
parameter.Nodes.Add(string.Format("user {0}", message.Parameters.UserName));
parameter.Nodes.Add(string.Format("engine id {0}", message.Parameters.EngineId.ToHexString()));
parameter.Nodes.Add(string.Format("engine boots {0}", message.Parameters.EngineBoots));
parameter.Nodes.Add(string.Format("engine time {0}", message.Parameters.EngineTime));
parameter.Nodes.Add(string.Format("checksum {0}", message.Parameters.AuthenticationParameters.ToHexString()));
parameter.Nodes.Add(string.Format("checksum broken {0}", message.Parameters.IsInvalid));
parameter.Nodes.Add(string.Format("encryption token {0}", message.Parameters.PrivacyParameters.ToHexString()));
}
else
{
parameter.Nodes.Add(string.Format("community {0}", message.Parameters.UserName));
}
var scope = messageNode.Nodes.Add("scope");
if (message.TypeCode() == SnmpType.Unknown)
{
scope.Nodes.Add("decryption error");
}
else if (OctetString.IsNullOrEmpty(message.Parameters.PrivacyParameters))
{
if (message.Version == VersionCode.V3)
{
scope.Nodes.Add(string.Format("context name {0}", message.Scope.ContextName));
scope.Nodes.Add(string.Format("context engine id {0}", message.Scope.ContextEngineId.ToHexString()));
}
var pdu = scope.Nodes.Add(string.Format("pdu type {0}", message.Scope.Pdu.TypeCode));
pdu.Nodes.Add(string.Format("request id {0}", message.Scope.Pdu.RequestId));
pdu.Nodes.Add(string.Format("error status {0}", message.Scope.Pdu.ErrorStatus.ToErrorCode()));
pdu.Nodes.Add(string.Format("error index {0}", message.Scope.Pdu.ErrorIndex));
var variables = pdu.Nodes.Add(string.Format("variable count {0}", message.Scope.Pdu.Variables.Count));
foreach (var variable in message.Scope.Pdu.Variables)
{
variables.Nodes.Add(variable.ToString());
}
}
else
{
scope.Nodes.Add("encrypted data");
}
tree.ExpandAll();
}
示例8: RecordStep
public static void RecordStep(TreeView tree, string step)
{
if (tree.Nodes[0] != null)
{
tree.BeginUpdate();
tree.Nodes[0].Nodes.Insert(tree.Nodes[0].Nodes.Count, step);
tree.EndUpdate();
tree.ExpandAll();
}
}
示例9: BindTableNameList
public void BindTableNameList(TreeView tv)
{
List<TableModel> list = idb.GetTableModelList(Utils.dbName);
tv.Nodes.Clear();
foreach (var item in list)
{
tv.Nodes.Add(item.TableName);
}
tv.ExpandAll();
}
示例10: InitTreeView
//public static void InitTreeView(TreeView treeView, DataRow row)
//{
// treeView.Nodes.Clear();
// if (row != null)
// {
// SetTreeViewData(treeView.Nodes, row);
// treeView.ExpandAll();
// if (treeView.Nodes.Count > 0) treeView.SelectedNode = treeView.Nodes[0];
// }
//}
#endregion
public static void InitTreeView(TreeView treeView, XElement e)
{
treeView.Nodes.Clear();
if (e != null)
{
SetTreeViewData(treeView.Nodes, e);
treeView.ExpandAll();
if (treeView.Nodes.Count > 0) treeView.SelectedNode = treeView.Nodes[0];
}
}
示例11: loadLoadBindableFieldsIntoTreeView
public void loadLoadBindableFieldsIntoTreeView(TreeView tvTargetTreeView, bool bHideGetAndSetStrings, bool clearPreviousList)
{
numberOfItemsProcessed = 0;
cirClassMapped = new List<ICirClass>();
if (clearPreviousList)
tvTargetTreeView.Nodes.Clear();
// make the first char upper case
addBindableFieldsIntoTreeView_Recursive(tvTargetTreeView.Nodes, cirRootClass, bHideGetAndSetStrings);
tvTargetTreeView.ExpandAll();
Callbacks.raiseRegistedCallbacks(onMapClassComplete);
}
示例12: BuildFieldTree
public static void BuildFieldTree(TreeView treeview, IEnumerable<IField> rootFields)
{
treeview.Nodes.Clear();
foreach (var rootField in rootFields)
{
var node = new TreeNode(rootField.FieldName);
node.Tag = rootField;
BuildFieldNode(node,rootField);
treeview.Nodes.Add(node);
}
treeview.ExpandAll();
}
示例13: CreateTreeView
public static void CreateTreeView(TreeView treeView1,DataTable dt)
{
TreeViewSchema tvwSchema = new TreeViewSchema();
tvwSchema.DataSource = dt;
tvwSchema.KeyMember = "Id";
tvwSchema.DisplayMember = "Node";
tvwSchema.ValueMember = "Id";
tvwSchema.ParentMember = "ParentId";
Helper.PopulateTree(treeView1, tvwSchema);
treeView1.ExpandAll();
treeView1.CheckBoxes = true;
treeView1.Nodes[0].Checked = true;
}
示例14: N_LoadDept
/*
* 外部调用
*/
#region [ 方法: 给TreeView控件加载部门 ]
public void N_LoadDept(TreeView tvDep)
{
//加载部门
using (ds = new DataSet())
{
ds = this.N_GetDeptInfo();
TreeNode tnDept = new TreeNode();
tnDept.Text = "所有部门";
tvDep.Nodes.Add(tnDept);
this.N_LoadChildDept(tnDept, 0, 0, ds.Tables[0].Rows.Count);
tvDep.ExpandAll();
}
}
示例15: BindReceipts
public void BindReceipts(TreeView ctrl)
{
var dir = this._cfg.GetReceiptDirectory();
ctrl.Nodes[0].Nodes.Clear();
for (var i = 0; i < dir.GetLength(1); i++)
{
TreeNode node = null;
node = new TreeNode(dir[0, i]);
node.Tag = dir[1, i];
ctrl.Nodes[0].Nodes.Add(node);
}
ctrl.ExpandAll();
}