本文整理汇总了C#中Aga.Controls.Tree.TreePath类的典型用法代码示例。如果您正苦于以下问题:C# TreePath类的具体用法?C# TreePath怎么用?C# TreePath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TreePath类属于Aga.Controls.Tree命名空间,在下文中一共展示了TreePath类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: GetChildren
public System.Collections.IEnumerable GetChildren(TreePath treePath)
{
if (treePath.IsEmpty())
return _list;
else
return null;
}
示例3: TreePathEventArgs
public TreePathEventArgs(TreePath path)
{
if (path == null)
throw new ArgumentNullException();
_path = path;
}
示例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));
}
示例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();
}
}
示例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;
}
示例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;
}
示例8: FindNode
public Node FindNode(TreePath path)
{
if (path.IsEmpty())
return this.Root;
return FindNode(this.Root, path, 0);
}
示例9: IsLeaf
public bool IsLeaf(TreePath path)
{
if (path.LastNode != null && path.LastNode is Expression) {
return !((Expression)path.LastNode).HasChildren();
}
return true;
}
示例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;
}
}
}
示例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"]);
}
示例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) }));
}
示例13: FindNode
public Node FindNode(TreePath path)
{
if (path.IsEmpty())
return _root;
else
return FindNode(_root, path, 0);
}
示例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;
}
示例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;
}