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


C# TreeView.GetHashCode方法代码示例

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


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

示例1: PopulateRecordBar

		public override void PopulateRecordBar(RecordList list)
		{
			CheckDisposed();

			if (this.IsShowing)
			{
				m_fOutOfDate = false;
			}
			else
			{
				m_fOutOfDate = true;
				return;
			}

			m_list = list;

			XWindow window = (XWindow)m_mediator.PropertyTable.GetValue("window");
			window.Cursor = Cursors.WaitCursor;
			window.TreeBarControl.IsFlatList = false;
			TreeView tree = (TreeView)window.TreeStyleRecordList;
			Set<int> expandedItems = new Set<int>();
			if (m_tree != null && !m_expand)
				GetExpandedItems(m_tree.Nodes, expandedItems);
			m_tree = tree;
			id = nextID++;
			treeHash = m_tree.GetHashCode();

			// Removing the handlers first seems to be necessary because multiple tree handlers are
			// working with one treeview. Only this active one should have handlers connected.
			// If we fail to do this, switching to a different list causes drag and drop to stop working.
			ReleaseRecordBar();

			tree.NodeMouseClick += new TreeNodeMouseClickEventHandler(tree_NodeMouseClick);
			tree.MouseDown += new MouseEventHandler(tree_MouseDown);
			tree.MouseMove += new MouseEventHandler(tree_MouseMove);
			tree.DragDrop += new DragEventHandler(tree_DragDrop);
			tree.DragOver += new DragEventHandler(tree_DragOver);
			tree.GiveFeedback += new GiveFeedbackEventHandler(tree_GiveFeedback);
			tree.ContextMenuStrip = CreateTreebarContextMenuStrip();
			tree.ContextMenuStrip.MouseClick += new MouseEventHandler(tree_MouseClicked);
			tree.AllowDrop = true;
			tree.BeginUpdate();
			window.ClearRecordBarList();	//don't want to directly clear the nodes, because that causes an event to be fired as every single note is removed!
			m_hvoToTreeNodeTable.Clear();

			// type size must be set before AddTreeNodes is called
			m_typeSize = list.TypeSize;
			AddTreeNodes(list.SortedObjects, tree);

			tree.Font = new System.Drawing.Font(list.FontName, m_typeSize);
			tree.ShowRootLines = m_hierarchical;

			if (m_expand)
				tree.ExpandAll();
			else
			{
				tree.CollapseAll();
				ExpandItems(tree.Nodes, expandedItems);
			}
			// Set the selection after expanding/collapsing the tree.  This allows the true
			// selection to be visible even when the tree is collapsed but the selection is
			// an internal node.  (See LT-4508.)
			UpdateSelection(list.CurrentObject);
			tree.EndUpdate();

			EnsureSelectedNodeVisible(tree);
			window.Cursor = Cursors.Default;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:68,代码来源:RecordBarTreeHandler.cs


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