• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TreeViewItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TreeViewItem的典型用法代码示例。如果您正苦于以下问题:C# TreeViewItem类的具体用法?C# TreeViewItem怎么用?C# TreeViewItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TreeViewItem类属于命名空间,在下文中一共展示了TreeViewItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: TreeViewItemBuilderTests

        public TreeViewItemBuilderTests()
        {
            var viewContext = TestHelper.CreateViewContext();

            item = new TreeViewItem();
            builder = new TreeViewItemBuilder(item, viewContext);
        }
开发者ID:vialpando09,项目名称:RallyPortal2,代码行数:7,代码来源:TreeViewItemBuilderTests.cs


示例2: DrawIconAndLabel

 protected override void DrawIconAndLabel(Rect rect, TreeViewItem item, string label, bool selected, bool focused, bool useBoldFont, bool isPinging)
 {
   if (!isPinging)
   {
     float contentIndent = this.GetContentIndent(item);
     rect.x += contentIndent;
     rect.width -= contentIndent;
   }
   AudioMixerItem audioMixerItem = item as AudioMixerItem;
   if (audioMixerItem == null)
     return;
   GUIStyle guiStyle = !useBoldFont ? TreeViewGUI.s_Styles.lineStyle : TreeViewGUI.s_Styles.lineBoldStyle;
   guiStyle.padding.left = (int) ((double) this.k_IconWidth + (double) this.iconTotalPadding + (double) this.k_SpaceBetweenIconAndText);
   guiStyle.Draw(rect, label, false, false, selected, focused);
   audioMixerItem.UpdateSuspendedString(false);
   if ((double) audioMixerItem.labelWidth <= 0.0)
     audioMixerItem.labelWidth = guiStyle.CalcSize(GUIContent.Temp(label)).x;
   Rect position = rect;
   position.x += audioMixerItem.labelWidth + 8f;
   EditorGUI.BeginDisabledGroup(true);
   guiStyle.Draw(position, audioMixerItem.infoText, false, false, false, false);
   EditorGUI.EndDisabledGroup();
   if (this.iconOverlayGUI == null)
     return;
   Rect rect1 = rect;
   rect1.width = this.k_IconWidth + this.iconTotalPadding;
   this.iconOverlayGUI(item, rect1);
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:28,代码来源:AudioMixersTreeViewGUI.cs


示例3: StartDrag

		public override void StartDrag(TreeViewItem draggedItem, List<int> draggedItemIDs)
		{
			if (!EditorApplication.isPlaying)
			{
				base.StartDrag(draggedItem, draggedItemIDs);
			}
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:7,代码来源:AudioGroupTreeViewDragging.cs


示例4: AudioMixerItem

 public AudioMixerItem(int id, int depth, TreeViewItem parent, string displayName, AudioMixerController mixer, string infoText)
   : base(id, depth, parent, displayName)
 {
   this.mixer = mixer;
   this.infoText = infoText;
   this.UpdateSuspendedString(true);
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:7,代码来源:AudioMixerItem.cs


示例5: DrawIconAndLabel

			protected override void DrawIconAndLabel(Rect rect, TreeViewItem itemRaw, string label, bool selected, bool focused, bool useBoldFont, bool isPinging)
			{
				FrameDebuggerTreeView.FDTreeViewItem fDTreeViewItem = (FrameDebuggerTreeView.FDTreeViewItem)itemRaw;
				float contentIndent = this.GetContentIndent(fDTreeViewItem);
				rect.x += contentIndent;
				rect.width -= contentIndent;
				string text;
				GUIContent content;
				GUIStyle gUIStyle;
				if (fDTreeViewItem.m_ChildEventCount > 0)
				{
					Rect position = rect;
					position.width -= 4f;
					text = fDTreeViewItem.m_ChildEventCount.ToString(CultureInfo.InvariantCulture);
					content = EditorGUIUtility.TempContent(text);
					gUIStyle = FrameDebuggerWindow.styles.rowTextRight;
					gUIStyle.Draw(position, content, false, false, false, false);
					rect.width -= gUIStyle.CalcSize(content).x + 8f;
				}
				if (fDTreeViewItem.id <= 0)
				{
					text = fDTreeViewItem.displayName;
				}
				else
				{
					text = FrameDebuggerWindow.s_FrameEventTypeNames[(int)fDTreeViewItem.m_FrameEvent.type] + fDTreeViewItem.displayName;
				}
				if (string.IsNullOrEmpty(text))
				{
					text = "<unknown scope>";
				}
				content = EditorGUIUtility.TempContent(text);
				gUIStyle = FrameDebuggerWindow.styles.rowText;
				gUIStyle.Draw(rect, content, false, false, false, selected && focused);
			}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:35,代码来源:FrameDebuggerTreeView.cs


示例6: TreeViewItemFactoryTests

        public TreeViewItemFactoryTests()
        {
            ViewContext viewContext = TestHelper.CreateViewContext();

            item = new TreeViewItem();
            factory = new TreeViewItemFactory(item, viewContext);
        }
开发者ID:hazzik,项目名称:telerikaspnetmvc,代码行数:7,代码来源:TreeViewItemFactoryTests.cs


示例7: AddVisibleChildrenRecursive

 private void AddVisibleChildrenRecursive(BackendData.Foo source, TreeViewItem dest)
 {
   if (this.IsExpanded(source.id))
   {
     if (source.children == null || source.children.Count <= 0)
       return;
     dest.children = new List<TreeViewItem>(source.children.Count);
     for (int index = 0; index < source.children.Count; ++index)
     {
       BackendData.Foo child = source.children[index];
       dest.children.Add((TreeViewItem) new FooTreeViewItem(child.id, dest.depth + 1, dest, child.name, child));
       ++this.itemCounter;
       this.AddVisibleChildrenRecursive(child, dest.children[index]);
     }
   }
   else
   {
     if (!source.hasChildren)
       return;
     dest.children = new List<TreeViewItem>()
     {
       new TreeViewItem(-1, -1, (TreeViewItem) null, string.Empty)
     };
   }
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:25,代码来源:LazyTestDataSource.cs


示例8: AddBranchAndChildren

        public void AddBranchAndChildren(TreeViewItem parent, ROMNode node)
        {
            string caption = node.GetROMObjectID();
            TreeViewItem current = null;
            if (parent != null)
            {
                current = new TreeViewItem();
                current.Header = caption;
                current.Tag = node;
                current.Name = "_" + node.GetROMGUID().Replace('-', '_');
                try
                {
                    treeCtrl.UnregisterName(current.Name);
                }
                catch { }
                treeCtrl.RegisterName(current.Name, current);
                parent.Items.Add(current);
            }

            ROMNode[] children = node.GetAllChildren(false);
            if (children != null) foreach (ROMNode child in children)
                {
                    AddBranchAndChildren(current, child);
                }
        }
开发者ID:e1d1s1,项目名称:Logician,代码行数:25,代码来源:ROMViewer.xaml.cs


示例9: AddVisibleChildrenRecursive

			private void AddVisibleChildrenRecursive(TreeViewTest.BackendData.Foo source, TreeViewItem dest)
			{
				if (this.IsExpanded(source.id))
				{
					if (source.children != null && source.children.Count > 0)
					{
						dest.children = new List<TreeViewItem>(source.children.Count);
						for (int i = 0; i < source.children.Count; i++)
						{
							TreeViewTest.BackendData.Foo foo = source.children[i];
							dest.children[i] = new TreeViewTest.FooTreeViewItem(foo.id, dest.depth + 1, dest, foo.name, foo);
							this.itemCounter++;
							this.AddVisibleChildrenRecursive(foo, dest.children[i]);
						}
					}
				}
				else
				{
					if (source.hasChildren)
					{
						dest.children = new List<TreeViewItem>
						{
							new TreeViewItem(-1, -1, null, string.Empty)
						};
					}
				}
			}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:27,代码来源:TreeViewTest.cs


示例10: DrawIconAndLabel

 protected override void DrawIconAndLabel(Rect rect, TreeViewItem item, string label, bool selected, bool focused, bool useBoldFont, bool isPinging)
 {
     if (!isPinging)
     {
         float contentIndent = this.GetContentIndent(item);
         rect.x += contentIndent;
         rect.width -= contentIndent;
     }
     AudioMixerItem item2 = item as AudioMixerItem;
     if (item2 != null)
     {
         GUIStyle style = !useBoldFont ? TreeViewGUI.s_Styles.lineStyle : TreeViewGUI.s_Styles.lineBoldStyle;
         style.padding.left = (int) ((base.k_IconWidth + base.iconTotalPadding) + base.k_SpaceBetweenIconAndText);
         style.Draw(rect, label, false, false, selected, focused);
         item2.UpdateSuspendedString(false);
         if (item2.labelWidth <= 0f)
         {
             item2.labelWidth = style.CalcSize(GUIContent.Temp(label)).x;
         }
         Rect position = rect;
         position.x += item2.labelWidth + 8f;
         EditorGUI.BeginDisabledGroup(true);
         style.Draw(position, item2.infoText, false, false, false, false);
         EditorGUI.EndDisabledGroup();
         if (base.iconOverlayGUI != null)
         {
             Rect rect3 = rect;
             rect3.width = base.k_IconWidth + base.iconTotalPadding;
             base.iconOverlayGUI(item, rect3);
         }
     }
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:32,代码来源:AudioMixersTreeViewGUI.cs


示例11: StartDrag

 public override void StartDrag(TreeViewItem draggedNode, List<int> draggedItemIDs)
 {
   DragAndDrop.PrepareStartDrag();
   DragAndDrop.SetGenericData("FooDragging", (object) new TestDragging.FooDragData(this.GetItemsFromIDs((IEnumerable<int>) draggedItemIDs)));
   DragAndDrop.objectReferences = new UnityEngine.Object[0];
   DragAndDrop.StartDrag(draggedItemIDs.Count.ToString() + " Foo" + (draggedItemIDs.Count <= 1 ? (object) string.Empty : (object) "s"));
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:7,代码来源:TestDragging.cs


示例12: StartDrag

 public override void StartDrag(TreeViewItem draggedItem, List<int> draggedItemIDs)
 {
     if (!SavedSearchFilters.IsSavedFilter(draggedItem.id) || (draggedItem.id != SavedSearchFilters.GetRootInstanceID()))
     {
         ProjectWindowUtil.StartDrag(draggedItem.id, draggedItemIDs);
     }
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:7,代码来源:ProjectBrowserColumnOneTreeViewDragging.cs


示例13: AddAnimatableObjectToHierarchy

 private TreeViewItem AddAnimatableObjectToHierarchy(GameObject root, EditorCurveBinding[] curveBindings, TreeViewItem parentNode, string path)
 {
     TreeViewItem item = new AddCurvesPopupObjectNode(parentNode, path, GetClassName(root, curveBindings[0])) {
         icon = AssetPreview.GetMiniThumbnail(AnimationUtility.GetAnimatedObject(root, curveBindings[0]))
     };
     List<TreeViewItem> visibleItems = new List<TreeViewItem>();
     List<EditorCurveBinding> list2 = new List<EditorCurveBinding>();
     for (int i = 0; i < curveBindings.Length; i++)
     {
         EditorCurveBinding binding = curveBindings[i];
         list2.Add(binding);
         if ((i == (curveBindings.Length - 1)) || (AnimationWindowUtility.GetPropertyGroupName(curveBindings[i + 1].propertyName) != AnimationWindowUtility.GetPropertyGroupName(binding.propertyName)))
         {
             TreeViewItem item2 = this.CreateNode(list2.ToArray(), item);
             if (item2 != null)
             {
                 visibleItems.Add(item2);
             }
             list2.Clear();
         }
     }
     visibleItems.Sort();
     TreeViewUtility.SetChildParentReferences(visibleItems, item);
     return item;
 }
开发者ID:demelev,项目名称:projectHL,代码行数:25,代码来源:AddCurvesPopupHierarchyDataSource.cs


示例14: CreateTreeView

        private void CreateTreeView()
        {
            if (processInfo == null)
                return;

            foreach (FrameInfo frame in processInfo.Frames)
            {
                TreeViewItem tviFrame = new TreeViewItem { Header = string.Format("Frame {0} ({1} - {2})", frame.FrameNumber, frame.BeginTime, frame.EndTime) };

                foreach (ThreadInfo thread in frame.ThreadItems)
                {
                    TreeViewItem tviThread = new TreeViewItem { Header = string.Format("Thread {0}", thread.Id) };

                    foreach (MicroThreadInfo mt in thread.MicroThreadItems)
                    {
                        TreeViewItem tviMicroThread = new TreeViewItem { Header = string.Format("MicroThread {0} ({1} - {2})", mt.Id, mt.BeginTime, mt.EndTime) };
                        tviThread.Items.Add(tviMicroThread);
                    }

                    tviFrame.Items.Add(tviThread);
                }

                treeView.Items.Add(tviFrame);
            }
        }
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:25,代码来源:ProcessSnapshotControl.xaml.cs


示例15: DragElement

		public override bool DragElement(TreeViewItem targetItem, Rect targetItemRect, bool firstItem)
		{
			AudioMixerTreeViewDragging.DragData dragData = DragAndDrop.GetGenericData("AudioMixerDragging") as AudioMixerTreeViewDragging.DragData;
			if (dragData == null)
			{
				DragAndDrop.visualMode = DragAndDropVisualMode.None;
				return false;
			}
			bool flag = targetItem == null;
			if (flag && this.m_TreeView.GetTotalRect().Contains(Event.current.mousePosition))
			{
				if (this.m_DropData != null)
				{
					this.m_DropData.dropTargetControlID = 0;
					this.m_DropData.rowMarkerControlID = 0;
				}
				if (Event.current.type == EventType.DragPerform)
				{
					DragAndDrop.AcceptDrag();
					if (this.m_MixersDroppedOnMixerCallback != null)
					{
						this.m_MixersDroppedOnMixerCallback(this.GetAudioMixersFromItems(dragData.m_DraggedItems), null);
					}
				}
				DragAndDrop.visualMode = DragAndDropVisualMode.Move;
				Event.current.Use();
				return false;
			}
			return base.DragElement(targetItem, targetItemRect, firstItem);
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:30,代码来源:AudioMixerTreeViewDragging.cs


示例16: DoDrag

		public override DragAndDropVisualMode DoDrag(TreeViewItem parentNode, TreeViewItem targetNode, bool perform, TreeViewDragging.DropPosition dragPos)
		{
			AudioMixerTreeViewDragging.DragData dragData = DragAndDrop.GetGenericData("AudioMixerDragging") as AudioMixerTreeViewDragging.DragData;
			if (dragData == null)
			{
				return DragAndDropVisualMode.None;
			}
			List<AudioMixerItem> draggedItems = dragData.m_DraggedItems;
			AudioMixerItem audioMixerItem = parentNode as AudioMixerItem;
			if (audioMixerItem != null && dragData != null)
			{
				List<AudioMixerGroupController> groupsToBeMoved = (
					from i in draggedItems
					select i.mixer.masterGroup).ToList<AudioMixerGroupController>();
				List<AudioMixerGroupController> allAudioGroupsSlow = audioMixerItem.mixer.GetAllAudioGroupsSlow();
				bool flag = AudioMixerController.WillModificationOfTopologyCauseFeedback(allAudioGroupsSlow, groupsToBeMoved, audioMixerItem.mixer.masterGroup, null);
				bool flag2 = this.ValidDrag(parentNode, draggedItems) && !flag;
				if (perform && flag2 && this.m_MixersDroppedOnMixerCallback != null)
				{
					this.m_MixersDroppedOnMixerCallback(this.GetAudioMixersFromItems(draggedItems), audioMixerItem.mixer);
				}
				return (!flag2) ? DragAndDropVisualMode.Rejected : DragAndDropVisualMode.Move;
			}
			return DragAndDropVisualMode.None;
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:25,代码来源:AudioMixerTreeViewDragging.cs


示例17: DoDrag

 public override DragAndDropVisualMode DoDrag(TreeViewItem parentItem, TreeViewItem targetItem, bool perform, TreeViewDragging.DropPosition dropPos)
 {
     HierarchyProperty property = new HierarchyProperty(HierarchyType.GameObjects);
     if ((parentItem == null) || (targetItem == null))
     {
         return InternalEditorUtility.HierarchyWindowDrag(null, perform, InternalEditorUtility.HierarchyDropMode.kHierarchyDropUpon);
     }
     if (this.allowDragBetween)
     {
         if (((dropPos == TreeViewDragging.DropPosition.Above) || (targetItem == null)) || !property.Find(targetItem.id, null))
         {
             property = null;
         }
     }
     else if (((dropPos == TreeViewDragging.DropPosition.Above) || (parentItem == null)) || !property.Find(parentItem.id, null))
     {
         property = null;
     }
     InternalEditorUtility.HierarchyDropMode kHierarchyDragNormal = InternalEditorUtility.HierarchyDropMode.kHierarchyDragNormal;
     if (this.allowDragBetween)
     {
         kHierarchyDragNormal = (dropPos != TreeViewDragging.DropPosition.Upon) ? InternalEditorUtility.HierarchyDropMode.kHierarchyDropBetween : InternalEditorUtility.HierarchyDropMode.kHierarchyDropUpon;
     }
     if (((parentItem != null) && (parentItem == targetItem)) && (dropPos != TreeViewDragging.DropPosition.Above))
     {
         kHierarchyDragNormal |= InternalEditorUtility.HierarchyDropMode.kHierarchyDropAfterParent;
     }
     return InternalEditorUtility.HierarchyWindowDrag(property, perform, kHierarchyDragNormal);
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:29,代码来源:GameObjectsTreeViewDragging.cs


示例18: AnimationWindowHierarchyNode

		public AnimationWindowHierarchyNode(int instanceID, int depth, TreeViewItem parent, Type animatableObjectType, string propertyName, string path, string displayName) : base(instanceID, depth, parent, displayName)
		{
			this.displayName = displayName;
			this.animatableObjectType = animatableObjectType;
			this.propertyName = propertyName;
			this.path = path;
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:7,代码来源:AnimationWindowHierarchyNode.cs


示例19: Employees

        public JsonResult Employees(TreeViewItem item)
        {
            var dataContext = new NorthwindEntities();
            if (!string.IsNullOrEmpty(item.Id))
            {
                var id = int.Parse(item.Id);
                var employees = from e in dataContext.Employees
                                where (e.ReportsTo == id)
                                select new
                                {
                                    id = e.EmployeeID,
                                    Name = e.FirstName + " " + e.LastName,
                                    hasChildren = e.Employees.Any()
                                };

                return Json(employees, JsonRequestBehavior.AllowGet);
            }
            else
            {
                return Json(dataContext.Employees.Where(e => e.ReportsTo == null).Select(e => new
                {
                    id = e.EmployeeID,
                    Name = e.FirstName + " " + e.LastName,
                    hasChildren = e.Employees.Any()
                }), JsonRequestBehavior.AllowGet);
            }
        }
开发者ID:danielkaradachki,项目名称:HomeWork,代码行数:27,代码来源:HomeController.cs


示例20: DoDrag

		public override DragAndDropVisualMode DoDrag(TreeViewItem parentItem, TreeViewItem targetItem, bool perform, TreeViewDragging.DropPosition dropPos)
		{
			HierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.GameObjects);
			if (parentItem == null || targetItem == null)
			{
				return InternalEditorUtility.HierarchyWindowDrag(null, perform, InternalEditorUtility.HierarchyDropMode.kHierarchyDropUpon);
			}
			if (this.allowDragBetween)
			{
				if (dropPos == TreeViewDragging.DropPosition.Above || targetItem == null || !hierarchyProperty.Find(targetItem.id, null))
				{
					hierarchyProperty = null;
				}
			}
			else
			{
				if (dropPos == TreeViewDragging.DropPosition.Above || parentItem == null || !hierarchyProperty.Find(parentItem.id, null))
				{
					hierarchyProperty = null;
				}
			}
			InternalEditorUtility.HierarchyDropMode hierarchyDropMode = InternalEditorUtility.HierarchyDropMode.kHierarchyDragNormal;
			if (this.allowDragBetween)
			{
				hierarchyDropMode = ((dropPos != TreeViewDragging.DropPosition.Upon) ? InternalEditorUtility.HierarchyDropMode.kHierarchyDropBetween : InternalEditorUtility.HierarchyDropMode.kHierarchyDropUpon);
			}
			if (parentItem != null && parentItem == targetItem && dropPos != TreeViewDragging.DropPosition.Above)
			{
				hierarchyDropMode |= InternalEditorUtility.HierarchyDropMode.kHierarchyDropAfterParent;
			}
			return InternalEditorUtility.HierarchyWindowDrag(hierarchyProperty, perform, hierarchyDropMode);
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:32,代码来源:GameObjectsTreeViewDragging.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TreeWalk类代码示例发布时间:2022-05-24
下一篇:
C# TreeView类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap