Ejemplo n.º 1
0
        public DirectoryEntry LoadChildren(DirectoryNodeViewModel node)
        {
            var tcs = new TaskCompletionSource <DirectoryEntry>();

            var request = new GetDirectoryEntriesRequest {
                ProjectPath           = node.GetProjectPath().Value,
                DirectoryRelativePath = node.RelativePath
            };

            _typedRequestProcessProxy.RunUnbufferedAsync(request,
                                                         response => { LoadChildrenCallback(tcs, response); },
                                                         response => { LoadChildrenErrorCallback(tcs, response); });

            return(tcs.Task.Result);
        }
Ejemplo n.º 2
0
        public DirectoryEntry LoadChildren(DirectoryNodeViewModel node)
        {
            // "fake" root node does not support loading children dynamically (they should have been set manually)
            if (string.IsNullOrEmpty(node.FullPathString))
            {
                return(null);
            }

            var tcs = new TaskCompletionSource <DirectoryEntry>();

            var request = new GetDirectoryEntriesRequest {
                ProjectPath           = node.GetProjectPath().Value,
                DirectoryRelativePath = node.RelativePath
            };

            _typedRequestProcessProxy.RunUnbufferedAsync(request, RunAsyncOptions.Default,
                                                         response => { LoadChildrenCallback(tcs, response); },
                                                         response => { LoadChildrenErrorCallback(tcs, response); });

            return(tcs.Task.Result);
        }