예제 #1
0
        public Task <SolutionTree> SetSolutionAsync([NotNull] string fullPath)
        {
            if (!fullPath.EndsWith(".sln"))
            {
                throw new SolutionPathInvalidException();
            }
            if (!File.Exists(fullPath))
            {
                throw new SolutionDoesNotExistException();
            }
            // ReSharper disable once AssignNullToNotNullAttribute
            var root = new TreeNode(Path.GetDirectoryName(fullPath));

            SetChildren(root);
            var solution = new SolutionTree(root);

            CurrentSolution.SetSolution(solution);
            return(Task.FromResult(CurrentSolution.Value));
        }
예제 #2
0
 SolutionTree ICurrentSolution.SetSolution(SolutionTree value)
 {
     _value = value;
     return(_value);
 }