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);
        }
        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);
        }