Beispiel #1
0
		public IEnumerable<object> FindNode(FindNodeContext ctx, ITreeNode root) {
			var node = root;
			foreach (var name in Names) {
				node.EnsureChildrenLoaded();
				yield return null;
				var tmp = node.DataChildren.OfType<IFileTreeNodeData>().FirstOrDefault(a => a.NodePathName.Equals(name));
				if (tmp == null)
					yield break;
				node = tmp.TreeNode;
			}
			ctx.Node = node == root ? null : node.Data as IFileTreeNodeData;
		}
Beispiel #2
0
		IEnumerable<object> GetNodes(GetNodesContext ctx, IFileTreeView fileTreeView) {
			var list = new List<IFileTreeNodeData>();
			var root = fileTreeView.TreeView.Root;
			var findCtx = new FindNodeContext();
			foreach (var path in paths) {
				foreach (var o in path.FindNode(findCtx, root))
					yield return o;
				if (findCtx.Node == null)
					yield break;
				list.Add(findCtx.Node);
			}
			ctx.Nodes = list.ToArray();
		}
Beispiel #3
0
 IEnumerable<object> GetNodes(GetNodesContext ctx, IFileTreeView fileTreeView)
 {
     var list = new List<IFileTreeNodeData>();
     var root = fileTreeView.TreeView.Root;
     var findCtx = new FindNodeContext();
     foreach (var path in paths) {
         foreach (var o in path.FindNode(findCtx, root))
             yield return o;
         if (findCtx.Node == null)
             yield break;
         list.Add(findCtx.Node);
     }
     ctx.Nodes = list.ToArray();
 }
Beispiel #4
0
 public IEnumerable<object> FindNode(FindNodeContext ctx, ITreeNode root)
 {
     var node = root;
     foreach (var name in Names) {
         node.EnsureChildrenLoaded();
         yield return null;
         var tmp = node.DataChildren.OfType<IFileTreeNodeData>().FirstOrDefault(a => a.NodePathName.Equals(name));
         if (tmp == null)
             yield break;
         node = tmp.TreeNode;
     }
     ctx.Node = node == root ? null : node.Data as IFileTreeNodeData;
 }