withSIX.Core.PathConfiguration.SetPaths C# (CSharp) Method

SetPaths() public method

public SetPaths ( IAbsoluteDirectoryPath appPath = null, IAbsoluteDirectoryPath dataPath = null, IAbsoluteDirectoryPath localDataPath = null, IAbsoluteDirectoryPath tempPath = null, IAbsoluteDirectoryPath configPath = null, IAbsoluteDirectoryPath toolPath = null, IAbsoluteDirectoryPath sharedDataPath = null ) : void
appPath IAbsoluteDirectoryPath
dataPath IAbsoluteDirectoryPath
localDataPath IAbsoluteDirectoryPath
tempPath IAbsoluteDirectoryPath
configPath IAbsoluteDirectoryPath
toolPath IAbsoluteDirectoryPath
sharedDataPath IAbsoluteDirectoryPath
return void
        public virtual void SetPaths(IAbsoluteDirectoryPath appPath = null, IAbsoluteDirectoryPath dataPath = null,
            IAbsoluteDirectoryPath localDataPath = null, IAbsoluteDirectoryPath tempPath = null,
            IAbsoluteDirectoryPath configPath = null, IAbsoluteDirectoryPath toolPath = null,
            IAbsoluteDirectoryPath sharedDataPath = null) {
            //if (PathsSet) throw new Exception("Paths are already set!");
            if (PathsSet)
                this.Logger().Debug("Paths were already set!");

            EntryLocation = CommonBase.AssemblyLoader.GetEntryLocation();
            EntryPath = CommonBase.AssemblyLoader.GetEntryPath();
            ProcessExtensions.DefaultWorkingDirectory = EntryPath;
            AppPath = appPath ?? GetAppPath();
            DataPath = dataPath ?? GetDataPath();
            NotePath = DataPath.GetChildDirectoryWithName("Notes");
            LocalDataRootPath = GetLocalDataRootPath();
            LocalDataPath = localDataPath ?? GetLocalDataPath();
            LocalDataSharedPath = sharedDataPath ?? GetLocalDataSharedPath();
            SharedDllPath = GetLocalSharedDllPath();
            LogPath = LocalDataPath.GetChildDirectoryWithName("Logs");
            TempPath = tempPath ??
                       Path.Combine(Path.GetTempPath(), Common.AppCommon.ApplicationName)
                           .ToAbsoluteDirectoryPath();
            ToolPath = toolPath ?? LocalDataSharedPath.GetChildDirectoryWithName("Tools");
            ToolMinGwBinPath = ToolPath.GetChildDirectoryWithName("mingw").GetChildDirectoryWithName("bin");
            ToolCygwinBinPath = ToolPath.GetChildDirectoryWithName("cygwin").GetChildDirectoryWithName("bin");
            ConfigPath = configPath ?? ToolPath.GetChildDirectoryWithName("Config");
            StartPath = Directory.GetCurrentDirectory().ToAbsoluteDirectoryPath();

            AwesomiumPath = LocalDataSharedPath.GetChildDirectoryWithName("CEF");

            MyDocumentsPath = GetMyDocumentsPath();
            ProgramDataPath = GetProgramDataPath();
            SharedFilesPath = AppPath;

            ServiceExePath = Common.IsMini ? EntryLocation : SharedFilesPath.GetChildFileWithName(ServiceExe);
            SelfUpdaterExePath = SharedFilesPath.GetChildFileWithName(SelfUpdaterExe);

            SynqRootPath = ProgramDataPath.GetChildDirectoryWithName("Synq");

            PathsSet = true;
        }

Usage Example

 public void Setup() {
     _processManager = A.Fake<IProcessManager>();
     _pathConfiguration = new PathConfiguration();
     CommonBase.AssemblyLoader = SharedSupport.GetAssemblyLoader();
     _pathConfiguration.SetPaths();
     _tempRsyncExe = _pathConfiguration.ToolCygwinBinPath.GetChildFileWithName("rsync.exe");
     _launcher = new RsyncLauncher(_processManager, _pathConfiguration, new RsyncOutputParser());
 }
All Usage Examples Of withSIX.Core.PathConfiguration::SetPaths