public List <LoadChildrenResult> LoadChildrenMultiple(
            RootNodeViewModel projectNode, ICollection <DirectoryNodeViewModel> nodes)
        {
            var tcs = new TaskCompletionSource <List <LoadChildrenResult> >();

            var request = new GetDirectoryEntriesMultipleRequest {
                ProjectPath      = projectNode.GetProjectPath().Value,
                RelativePathList = nodes.Select(x => x.RelativePath).ToList()
            };

            _typedRequestProcessProxy.RunUnbufferedAsync(request,
                                                         response => { LoadChildrenMultipleCallback(tcs, nodes, response); },
                                                         response => { LoadChildrenMultipleErrorCallback(tcs, response); });

            return(tcs.Task.Result);
        }
        public IList <LoadChildrenResult> LoadChildrenMultiple(
            RootNodeViewModel projectNode, ICollection <DirectoryNodeViewModel> nodes)
        {
            // "fake" root node does not support loading children dynamically (they should have been set manually)
            if (string.IsNullOrEmpty(projectNode.FullPathString))
            {
                return(ArrayUtilities.EmptyList <LoadChildrenResult> .Instance);
            }


            var tcs = new TaskCompletionSource <List <LoadChildrenResult> >();

            var request = new GetDirectoryEntriesMultipleRequest {
                ProjectPath      = projectNode.GetProjectPath().Value,
                RelativePathList = nodes.Select(x => x.RelativePath).ToList()
            };

            _typedRequestProcessProxy.RunUnbufferedAsync(request, RunAsyncOptions.Default,
                                                         response => { LoadChildrenMultipleCallback(tcs, nodes, response); },
                                                         response => { LoadChildrenMultipleErrorCallback(tcs, response); });

            return(tcs.Task.Result);
        }