本文整理汇总了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);
}
}
}
示例2: FindNode
public Node FindNode(TreePath path)
{
if (path.IsEmpty())
return this.Root;
return FindNode(this.Root, path, 0);
}
示例3: FindNode
public Node FindNode(TreePath path)
{
if (path.IsEmpty())
return _root;
else
return FindNode(_root, path, 0);
}
示例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;
}
示例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;
}
示例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;
}
}
}
示例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;
}
}
示例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;
}
示例9: GetChildren
public System.Collections.IEnumerable GetChildren(TreePath treePath)
{
if (treePath.IsEmpty())
return _list;
else
return null;
}
示例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;
}
}
}
示例11: IsLeaf
public override bool IsLeaf(TreePath treePath)
{
if (treePath.IsEmpty())
return false;
var node = (PluginDetailsNode)treePath.LastNode;
return node.Name != "Disabled" || !serviceDescriptor.IsDisabled;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}