GitScc.SccProviderService.GetSolutionFileName C# (CSharp) 메소드

GetSolutionFileName() 공개 메소드

Returns the filename of the solution
public GetSolutionFileName ( ) : Task
리턴 Task
        public async Task<string> GetSolutionFileName()
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
            IVsSolution sol = (IVsSolution)_sccProvider.GetService(typeof(SVsSolution));
            string solutionDirectory, solutionFile, solutionUserOptions;
            if (sol.GetSolutionInfo(out solutionDirectory, out solutionFile, out solutionUserOptions) == VSConstants.S_OK)
            {
                return solutionFile;
            }
            else
            {
                return null;
            }
        }

Usage Example

        private string GetTargetPath(GitToolCommand command)
        {
            var workingDirectory = sccService.CurrentGitWorkingDirectory;

            if (command.Scope == CommandScope.Project)
            {
                return(workingDirectory);
            }
            var fileName = sccService.GetSelectFileName();

            if (fileName == sccService.GetSolutionFileName())
            {
                return(workingDirectory);
            }
            return(fileName);
        }
All Usage Examples Of GitScc.SccProviderService::GetSolutionFileName
SccProviderService