本文整理汇总了C#中Aga.Controls.Tree.TreePath类的典型用法代码示例。如果您正苦于以下问题:C# TreePath类的具体用法?C# TreePath怎么用?C# TreePath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TreePath类属于Aga.Controls.Tree命名空间,在下文中一共展示了TreePath类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetChildren
public override System.Collections.IEnumerable GetChildren(TreePath treePath)
{
Task t= treePath.LastNode as Task;
if(t==null)
return new List<Task>(this.projects);
return t.Tasks;
}
开发者ID:masterspambot,项目名称:MyProject,代码行数:7,代码来源:TaskTreeModel.cs
示例2: GetChildren
public System.Collections.IEnumerable GetChildren(TreePath treePath)
{
if (treePath.IsEmpty())
return _list;
else
return null;
}
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:7,代码来源:TreeListAdapter.cs
示例3: TreePathEventArgs
public TreePathEventArgs(TreePath path)
{
if (path == null)
throw new ArgumentNullException();
_path = path;
}
开发者ID:ASK-sa,项目名称:ASK.ServEasy,代码行数:7,代码来源:TreePathEventArgs.cs
示例4: IsLeaf
public override bool IsLeaf(TreePath treePath)
{
if (Settings.Default.AreasViewAsList)
return true;
Area item = treePath.LastNode as Area;
return item != null && ((item.ChildAreas != null && item.ChildAreas.Count == 0) | (item.Equipments.Count == 0));
}
开发者ID:Winsor,项目名称:ITInfra,代码行数:7,代码来源:AreasTreeModel_.cs
示例5: HandleModelChanged
protected override void HandleModelChanged(object sender, ModelChangedArgs e) {
TreePath treePath = new TreePath(view.Tree.Root);
switch (e.Context) {
case EventContext.WorkitemPropertiesUpdatedFromView:
HandleWorkitemPropertiesUpdated(PropertyUpdateSource.WorkitemView);
break;
case EventContext.WorkitemPropertiesUpdatedFromPropertyView:
HandleWorkitemPropertiesUpdated(PropertyUpdateSource.WorkitemPropertyView);
break;
case EventContext.WorkitemsChanged:
treePath = view.Tree.GetPath(view.CurrentNode.Level == 2 ? view.CurrentNode.Parent : view.CurrentNode);
model.InvokeStructureChanged(treePath);
break;
case EventContext.VirtualWorkitemRemoved:
treePath = view.Tree.GetPath(view.CurrentNode.Parent??view.Tree.Root);
model.InvokeStructureChanged(treePath);
break;
case EventContext.ProjectSelected:
HandleModelChanged();
break;
case EventContext.WorkitemsRequested:
HandleModelChanged();
break;
case EventContext.WorkitemSaved:
treePath = view.Tree.GetPath(view.CurrentNode.Level == 2 ? view.CurrentNode.Parent : view.CurrentNode);
model.InvokeStructureChanged(treePath);
break;
case EventContext.WorkitemCacheInvalidated:
assetCache.Drop();
break;
default:
throw new NotSupportedException();
}
}
开发者ID:cagatayalkan,项目名称:VersionOne.Client.VisualStudio,代码行数:34,代码来源:WorkitemTreeController.cs
示例6: 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
示例7: TreePath
public TreePath(TreePath parent, object node)
{
_path = new object[parent.FullPath.Length + 1];
for (int i = 0; i < _path.Length - 1; i++)
_path[i] = parent.FullPath[i];
_path[_path.Length - 1] = node;
}
开发者ID:AndrewTPohlmann,项目名称:open-hardware-monitor,代码行数:7,代码来源:TreePath.cs
示例8: 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
示例9: IsLeaf
public bool IsLeaf(TreePath path)
{
if (path.LastNode != null && path.LastNode is Expression) {
return !((Expression)path.LastNode).HasChildren();
}
return true;
}
开发者ID:dp0h,项目名称:QuickWatchEx,代码行数:7,代码来源:TreeModel.cs
示例10: 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
示例11: IsLeaf
public override bool IsLeaf(TreePath treePath)
{
DataRowNode n = treePath.LastNode as DataRowNode;
if (n.Row["IsFolder"] == DBNull.Value)
return false;
return !Convert.ToBoolean(n.Row["IsFolder"]);
}
开发者ID:montague247,项目名称:treeviewadv,代码行数:7,代码来源:DataTableTreeModel.cs
示例12: ReportRenamed
private void ReportRenamed(string oldReportName, string newReportName)
{
var treePath = new TreePath(new[] { projectRoot, reportsNode });
OnNodesRemoved(new TreeModelEventArgs(treePath, new[] { new ReportNode(oldReportName) }));
OnNodesInserted(new TreeModelEventArgs(treePath, new[] { 0 },
new[] { new ReportNode(newReportName) }));
}
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:ProjectTreeModel.cs
示例13: FindNode
public Node FindNode(TreePath path)
{
if (path.IsEmpty())
return _root;
else
return FindNode(_root, path, 0);
}
开发者ID:Celtech,项目名称:BolDevStudio,代码行数:7,代码来源:TreeModel.cs
示例14: 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
示例15: GetChildren
public System.Collections.IEnumerable GetChildren(TreePath treePath)
{
this.InitAssemblyCache();
List<BaseItem> items = new List<BaseItem>();
BaseItem parentItem = treePath.LastNode as BaseItem;
TypeItem parentTypeItem = parentItem as TypeItem;
NamespaceItem parentNamespaceItem = parentItem as NamespaceItem;
Type parentType = parentTypeItem != null ? parentTypeItem.TypeInfo : this.baseType;
string parentName = parentNamespaceItem != null ? parentNamespaceItem.Name : null;
if (this.showNamespaces && parentTypeItem == null)
{
foreach (string subName in this.GetSubNamespaces(parentName))
{
items.Add(new NamespaceItem(subName, parentItem));
}
}
if (!this.showNamespaces || parentName != null)
{
foreach (Assembly assembly in this.assemblies)
{
foreach (Type exportedType in assembly.GetExportedTypes())
{
if (this.showNamespaces && exportedType.Namespace != parentName) continue;
if (exportedType.BaseType != parentType && (!parentType.IsInterface || !exportedType.GetInterfaces().Contains(parentType))) continue;
if (this.filter != null && !this.filter(exportedType)) continue;
items.Add(new TypeItem(exportedType, parentItem));
}
}
}
return items;
}
开发者ID:CKoewing,项目名称:duality,代码行数:35,代码来源:TypeBrowserTreeModel.cs
示例16: 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
示例17: 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
示例18: 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
示例19: 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
示例20: IsLeaf
public virtual bool IsLeaf(TreePath treePath)
{
Node node = FindNode(treePath);
if (node != null)
return node.IsLeaf;
else
throw new ArgumentException("treePath");
}
开发者ID:montague247,项目名称:treeviewadv,代码行数:8,代码来源:TreeModel.cs
注:本文中的Aga.Controls.Tree.TreePath类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论