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


C# TreePath.IsEmpty方法代码示例

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


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

示例1: GetChildren

 public override IEnumerable GetChildren(TreePath treePath)
 {
     if (treePath.IsEmpty())
     {
         yield return new PluginDetailsNode("Component Handler Factory", componentDescriptor.ComponentHandlerFactory.ToString());
         yield return new PluginDetailsNode("Component Properties", string.Empty);
         yield return new PluginDetailsNode("Component Type Name", componentDescriptor.ComponentTypeName.FullName);
         yield return new PluginDetailsNode("Disabled", componentDescriptor.IsDisabled.ToString());
         yield return new PluginDetailsNode("Traits Properties", string.Empty);
     }
     else
     {
         var node = (PluginDetailsNode) treePath.LastNode;
         if (node.Name == "Component Properties")
         {
             if (componentDescriptor.ComponentProperties != null)
                 foreach (var property in componentDescriptor.ComponentProperties)
                     yield return new PluginDetailsNode(property.Key, property.Value);
         }
         else if (node.Name == "Disabled" && componentDescriptor.IsDisabled)
         {
             yield return new PluginDetailsNode("Disabled Reason", componentDescriptor.DisabledReason);
         }
         else if (node.Name == "Traits Properties")
         {
             if (componentDescriptor.TraitsProperties != null)
                 foreach (var property in componentDescriptor.TraitsProperties)
                     yield return new PluginDetailsNode(property.Key, property.Value);
         }
     }
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:31,代码来源:ComponentDetailsTreeModel.cs

示例2: FindNode

		public Node FindNode(TreePath path)
		{
			if (path.IsEmpty())
				return this.Root;

            return FindNode(this.Root, path, 0);
		}
开发者ID:john-peterson,项目名称:processhacker,代码行数:7,代码来源:TreeModel.cs

示例3: FindNode

 public Node FindNode(TreePath path)
 {
     if (path.IsEmpty())
         return _root;
     else
         return FindNode(_root, path, 0);
 }
开发者ID:Celtech,项目名称:BolDevStudio,代码行数:7,代码来源:TreeModel.cs

示例4: GetChildren

 public override IEnumerable GetChildren(TreePath treePath)
 {
     List<TemplateTreeItem> dataItems = new List<TemplateTreeItem>();
     if (treePath.IsEmpty())
     {
         var data = _dataSource.GroupBy(i => Regex.Matches(i.Description, @"\b[\w]*\b").Cast<Match>().First().Value);
         dataItems.AddRange(data.Select(group => new TemplateTreeItem()
         {
             Description = group.Key, Id = Guid.NewGuid(), IsLeaf = !group.Any(), Tag = group
         }).OrderBy(o=>o.Description));
     }
     else
     {
         IGrouping<string, EquipmentTemplate> items = ((TemplateTreeItem)treePath.LastNode).Tag as IGrouping<string, EquipmentTemplate>;
         if (items==null)
             throw new Exception("Error in tree");
         dataItems.AddRange(items.Select(item => new TemplateTreeItem()
         {
             Description = item.Description,
             Id = item.ElementId,
             IsLeaf = true,
             Tag = item
         }).OrderBy(o => o.Description));
     }
     return dataItems;
 }
开发者ID:Winsor,项目名称:ITInfra,代码行数:26,代码来源:TemplateTreeModel.cs

示例5: IsLeaf

        public bool IsLeaf(TreePath treePath)
        {
            if (treePath.IsEmpty())
            {
                var relations = _dataService.GetRelations(null);
                return relations == null || !relations.Any();
            }

            if (treePath.LastNode is DbItem)
            {
                var item = treePath.LastNode as DbItem;
                var relations = _dataService.GetRelations(item.Id);
                return relations == null || !relations.Any();
            }
            else if (treePath.LastNode is DbRelation)
            {
                var relation = treePath.LastNode as DbRelation;
                if (relation.ToId != null)
                {
                    var item = _dataService.GetItem(relation.ToId.Value);
                    return item == null;
                }
            }

            return true;
        }
开发者ID:SorenHK,项目名称:sdb,代码行数:26,代码来源:SDBTreeModel.cs

示例6: GetChildren

 public override IEnumerable GetChildren(TreePath treePath)
 {
     if (treePath.IsEmpty())
     {
         yield return root;
     }
     else if (treePath.LastNode == root)
     {                
         foreach (var pluginDescriptor in PluginDescriptors)
         {
             var pluginNode = new PluginNode(pluginDescriptor);
             root.Nodes.Add(pluginNode);
             foreach (var file in pluginDescriptor.FilePaths)
             {
                 var fullPath = Path.Combine(pluginDescriptor.BaseDirectory.FullName, file);
                 var exists = fileSystem.FileExists(fullPath);
                 pluginNode.Nodes.Add(new FileNode(file, exists));
             }
             yield return pluginNode;
         }
     }
     else if (treePath.LastNode is PluginNode)
     {
         var pluginNode = (PluginNode) treePath.LastNode;
         foreach (var child in pluginNode.Nodes)
         {
             yield return child;
         }
     }
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:30,代码来源:PluginTreeModel.cs

示例7: GetChildren

        public System.Collections.IEnumerable GetChildren(TreePath treePath)
        {
            if (treePath.IsEmpty())
                foreach (string str in Environment.GetLogicalDrives())
                {
                    RootItem item = new RootItem(str);
                    yield return item;
                }
            else
            {
                List<BaseItem> items = new List<BaseItem>();
                BaseItem parent = treePath.LastNode as BaseItem;
                if (parent != null)
                {
                    foreach (string str in Directory.GetDirectories(parent.ItemPath))
                        items.Add(new FolderItem(str, parent));
                    foreach (string str in Directory.GetFiles(parent.ItemPath))
                        items.Add(new FileItem(str, parent));

                    _itemsToRead.AddRange(items);
                    if (!_worker.IsBusy)
                        _worker.RunWorkerAsync();

                    foreach (BaseItem item in items)
                        yield return item;
                }
                else
                    yield break;
            }
        }
开发者ID:ishani,项目名称:VSOExp,代码行数:30,代码来源:FolderBrowserModel.cs

示例8: GetChildren

        public override System.Collections.IEnumerable GetChildren(TreePath treePath)
        {
            List<DataRowNode> items = new List<DataRowNode>();

            if (treePath.IsEmpty() )
            {
                items.Add(m_root);
            }
            else
            {
                DataRowNode n = treePath.LastNode as DataRowNode;

                DataRow row = n.Row;
                int id = Convert.ToInt32(row[m_IDColumnName]);

                DataRow[] rows = m_table.Select("ParentID = " + id+" and "+m_IDColumnName+" <> "+id);
                foreach (DataRow r in rows)
                {
                    DataRowNode node = new DataRowNode(r,r["Name"].ToString());
                    node.Row = r;
                    //SampleApp.Properties.Resources.ResourceManager.
                    //node.Icon = new Bitmap(SampleApp.Properties.Resources.Records,new Size(15,15));
                    items.Add(node);
                }
            }
            return items;
        }
开发者ID:kanbang,项目名称:Colt,代码行数:27,代码来源:DataTableTreeModel.cs

示例9: GetChildren

 public System.Collections.IEnumerable GetChildren(TreePath treePath)
 {
     if (treePath.IsEmpty())
     return _list;
        else
     return null;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:7,代码来源:TreeListAdapter.cs

示例10: GetChildren

 public override IEnumerable GetChildren(TreePath treePath)
 {
     if (treePath.IsEmpty())
     {
         yield return new PluginDetailsNode("Assembly References", string.Empty);
         yield return new PluginDetailsNode("Base Directory", pluginDescriptor.BaseDirectory.FullName);
         yield return new PluginDetailsNode("Disabled", pluginDescriptor.IsDisabled.ToString());
         yield return new PluginDetailsNode("Plugin Dependencies", string.Empty);
         yield return
             new PluginDetailsNode("Plugin Handler Factory", pluginDescriptor.PluginHandlerFactory.ToString())
             ;
         yield return new PluginDetailsNode("Plugin Properties", string.Empty);
         yield return new PluginDetailsNode("Plugin Type Name", pluginDescriptor.PluginTypeName.FullName);
         yield return new PluginDetailsNode("Probing Paths", string.Empty);
         yield return new PluginDetailsNode("Traits Properties", string.Empty);
     }
     else
     {
         var node = (PluginDetailsNode) treePath.LastNode;
         if (node.Name == "Assembly References" && pluginDescriptor.AssemblyBindings != null)
         {
             foreach (var assemblyReference in pluginDescriptor.AssemblyBindings)
             {
                 string codeBase = assemblyReference.CodeBase != null ? 
                     assemblyReference.CodeBase.ToString() : "(unknown)";
                 yield return new PluginDetailsNode(assemblyReference.AssemblyName.ToString(), 
                     codeBase);
             }
         }
         else if (node.Name == "Disabled" && pluginDescriptor.IsDisabled)
         {
             yield return new PluginDetailsNode("Disabled Reason", pluginDescriptor.DisabledReason);
         }
         else
             switch (node.Name)
             {
                 case "Plugin Dependencies":
                     if (pluginDescriptor.PluginDependencies != null)
                         foreach (var pluginDependency in pluginDescriptor.PluginDependencies)
                             yield return new PluginDetailsNode(pluginDependency.PluginId, string.Empty);
                     break;
                 case "Plugin Properties":
                     if (pluginDescriptor.PluginProperties != null)
                         foreach (var pluginProperty in pluginDescriptor.PluginProperties)
                             yield return new PluginDetailsNode(pluginProperty.Key, pluginProperty.Value);
                     break;
                 case "Probing Paths":
                     if (pluginDescriptor.ProbingPaths != null)
                         foreach (var probingPath in pluginDescriptor.ProbingPaths)
                             yield return new PluginDetailsNode(probingPath, string.Empty);
                     break;
                 case "Traits Properties":
                     if (pluginDescriptor.TraitsProperties != null)
                         foreach (var traitsProperty in pluginDescriptor.TraitsProperties)
                             yield return new PluginDetailsNode(traitsProperty.Key, traitsProperty.Value);
                     break;
             }
     }
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:59,代码来源:PluginDetailsTreeModel.cs

示例11: IsLeaf

        public override bool IsLeaf(TreePath treePath)
        {
            if (treePath.IsEmpty())
                return false;

            var node = (PluginDetailsNode)treePath.LastNode;
            return node.Name != "Disabled" || !serviceDescriptor.IsDisabled;
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:8,代码来源:ServiceDetailsTreeModel.cs

示例12: GetChildren

        /// <summary>Grabs the children of the passed path</summary>
        /// <param name="treePath">Path to get the children of</param>
        /// <returns>IEnumerable collection with the child items</returns>
        public IEnumerable GetChildren(TreePath treePath)
        {
            List<BaseItem> items = new List<BaseItem>();
            if (treePath.IsEmpty())
            {
                if (_tree.Cache.ContainsKey("ROOT"))
                {
                    items = _tree.Cache["ROOT"];
                }
                else
                {
                    items = new List<BaseItem>();
                    _tree.Cache.Add("ROOT", items);
                }
            }
            else
            {
                ServerItem server = treePath.FirstNode as ServerItem;
                BaseItem database = treePath.FullPath.FirstOrDefault(i => (i as BaseItem).Type == ItemType.Database) as BaseItem;
                BaseItem parent = treePath.LastNode as BaseItem;
                if (parent != null && server != null)
                {
                    if (_tree.Cache.ContainsKey(parent.ItemPath))
                    {
                        items = _tree.Cache[parent.ItemPath];
                    }
                    else
                    {
                        //Populate the items based on the parent
                        switch (parent.Type)
                        {
                            case ItemType.Server:
                                items = GetDatabases(server);
                                break;
                            case ItemType.Database:
                                items = GetDatabaseChildren(parent);
                                break;
                            case ItemType.Folder:
                                if (database != null)
                                    items = GetFolderChildren(parent, server, database.Name);
                                break;
                            case ItemType.Table:
                            case ItemType.View:
                                items = GetTableViewChildren(parent);
                                break;
                            default:
                                break;
                        }

                        _tree.Cache.Add(parent.ItemPath, items);
                    }

                    parent.IsLoaded = true;
                }
            }

            return items;
        }
开发者ID:meandthewallaby,项目名称:Edrych,代码行数:61,代码来源:ServerBrowserViewModel.cs

示例13: GetChildren

 public IEnumerable GetChildren(TreePath treePath)
 {
     if (this.RootSection == null)
         return null;
     SectionEntry ed = treePath.IsEmpty() ? this.RootSection : ((SectionEntry)treePath.LastNode);
     List<Entry> ret = new List<Entry>(ed.Entries);
     ret.Add(null);//a null entry, which will be the button for adding new entries
     return ret;
 }
开发者ID:yuo123,项目名称:CK2Editor,代码行数:9,代码来源:FileEditorGUI.cs

示例14: GetChildren

        public IEnumerable GetChildren(TreePath treePath) {
            if (!controller.CanRetrieveData) {
                return null;
            }

            if(treePath.IsEmpty()) {
                var workitems = controller.GetWorkitems();
                return workitems != null ? WrapWorkitems(workitems) : new WorkitemDescriptor[0];
            }

            var descriptor = (WorkitemDescriptor) treePath.LastNode;
            return WrapWorkitems(descriptor.Workitem.Children);
        }
开发者ID:cagatayalkan,项目名称:VersionOne.Client.VisualStudio,代码行数:13,代码来源:StoryTreeModel.cs

示例15: GetChildren

 public override IEnumerable GetChildren(TreePath treePath)
 {
     List<EquipmentTemplate> templates=new List<EquipmentTemplate>();
     if (treePath.IsEmpty())
     {
         templates = _cachedTemplates.Where(temp => temp.ParentElementTemplate == null).OrderBy(item => item.Description).ToList();
     }
     else
     {
         EquipmentTemplate parentTemplate = (EquipmentTemplate)treePath.LastNode;
         if (parentTemplate == null) return templates;
         templates = _cachedTemplates.Where(temp => temp.ParentElementId == parentTemplate.ElementId).OrderBy(item => item.Position).ToList();
     }
     return templates;
 }
开发者ID:Winsor,项目名称:ITInfra,代码行数:15,代码来源:EquipmentTemplatesTreeModel.cs


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