当前位置: 首页>>代码示例>>C#>>正文


C# IAbsoluteDirectoryPath.GetChildDirectoryWithName方法代码示例

本文整理汇总了C#中IAbsoluteDirectoryPath.GetChildDirectoryWithName方法的典型用法代码示例。如果您正苦于以下问题:C# IAbsoluteDirectoryPath.GetChildDirectoryWithName方法的具体用法?C# IAbsoluteDirectoryPath.GetChildDirectoryWithName怎么用?C# IAbsoluteDirectoryPath.GetChildDirectoryWithName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAbsoluteDirectoryPath的用法示例。


在下文中一共展示了IAbsoluteDirectoryPath.GetChildDirectoryWithName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleUserconfig

 void HandleUserconfig(IAbsoluteDirectoryPath dir) {
     var userConfigPath = dir.GetChildDirectoryWithName("userconfig");
     if (!userConfigPath.Exists)
         return;
     System.Console.WriteLine("Found userconfig in {0}, processing", dir);
     HandleUserConfigPath(dir, userConfigPath);
 }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:7,代码来源:HandleUserconfigCommand.cs

示例2: ProcessUserconfig

        public string ProcessUserconfig(IAbsoluteDirectoryPath modPath, IAbsoluteDirectoryPath gamePath,
            string exisitingChecksum, bool force = true) {
            Contract.Requires<ArgumentNullException>(modPath != null);
            Contract.Requires<ArgumentNullException>(gamePath != null);

            var backupAndClean = force;

            var path = GetUserconfigPath(modPath);
            if (!File.Exists(path) && !Directory.Exists(path))
                return null;

            this.Logger().Info("Found userconfig to process at " + path);

            var checksum = GetConfigChecksum(path);

            if (checksum != exisitingChecksum)
                backupAndClean = true;

            var uconfig = gamePath.GetChildDirectoryWithName("userconfig");
            var uconfigPath = uconfig.GetChildDirectoryWithName(Mod.GetRepoName(modPath.DirectoryName));

            if (backupAndClean)
                new UserconfigBackupAndClean().ProcessBackupAndCleanInstall(path, gamePath, uconfig, uconfigPath);
            else
                new UserconfigUpdater().ProcessMissingFiles(path, gamePath, uconfig, uconfigPath);

            return checksum;
        }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:28,代码来源:UserconfigProcessor.cs

示例3: MigrateServerModFolder

 static void MigrateServerModFolder(IAbsoluteDirectoryPath modFolder, IAbsoluteDirectoryPath modPath) {
     var folderName = modFolder.DirectoryName;
     var destination = modPath.GetChildDirectoryWithName(folderName);
     if (!destination.Exists)
         Tools.FileUtil.Ops.MoveDirectory(modFolder, destination);
     else
         Directory.Delete(modFolder.ToString(), true);
 }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:8,代码来源:ServerModsMigrator.cs

示例4: TryMoveDir

 static void TryMoveDir(IAbsoluteDirectoryPath dir, IAbsoluteDirectoryPath newModsPath) {
     var newPath = newModsPath.GetChildDirectoryWithName(dir.DirectoryName);
     try {
         if (newPath.Exists)
             Directory.Delete(newPath.ToString(), true);
     } finally {
         Tools.FileUtil.Ops.MoveDirectory(dir, newPath);
     }
 }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:9,代码来源:PathMover.cs

示例5: ScanForAddonFolders

 LocalContent ScanForAddonFolders(IAbsoluteDirectoryPath path) {
     var dirs = new[] {"addons", "dta", "common", "dll"};
     if (dirs.Any(x => !path.GetChildDirectoryWithName(x).IsEmptySafe())) {
         return !HasContentAlready(path.DirectoryName)
             ? new ModLocalContent(path.DirectoryName.ToLower(), _realVirtualityGame.Id,
                 new BasicInstallInfo())
             : null;
     }
     return null;
 }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:10,代码来源:RvContentScanner.cs

示例6: YomaContent

 public YomaContent(IAbsoluteDirectoryPath destination, Uri uri, IFileDownloadHelper downloader) {
     Contract.Requires<ArgumentNullException>(destination != null);
     _downloader = downloader;
     Destination = destination;
     YasDir = Destination.GetChildDirectoryWithName(".yas");
     FilesDir = YasDir.GetChildDirectoryWithName("files");
     Url = uri;
     ConfigArchive = YasDir.GetChildFileWithName("config" + ArchiveExtension);
     TmpPath = YasDir.GetChildDirectoryWithName("tmp");
 }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:10,代码来源:YomaContent.cs

示例7: SteamDirectories

        public SteamDirectories(uint appId, string folder, IAbsoluteDirectoryPath steamPath) {
            Contract.Requires<ArgumentNullException>(appId > 0);
            Contract.Requires<ArgumentNullException>(folder != null);
            Contract.Requires<ArgumentNullException>(steamPath != null);

            // TODO: Take LibraryPath from KV store
            RootPath = steamPath.GetChildDirectoryWithName("steamapps");
            Game = new SteamGameDirectories(folder, RootPath);
            Workshop = new SteamWorkshopDirectories(appId, RootPath);
        }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:10,代码来源:SteamDirectories.cs

示例8: HandleUserconfigFiles

 void HandleUserconfigFiles(IAbsoluteDirectoryPath userConfigPath, IAbsoluteDirectoryPath storePath,
     IEnumerable<FileInfo> files) {
     System.Console.WriteLine("File based userconfig");
     var subDir =
         userConfigPath.GetChildDirectoryWithName(
             userConfigPath.ParentDirectoryPath.DirectoryName.ToLower().Replace("@", ""));
     subDir.MakeSurePathExists();
     foreach (var f in files)
         f.MoveTo(subDir.GetChildFileWithName(f.Name).ToString());
     WriteUserConfigTar(userConfigPath, storePath);
     userConfigPath.DirectoryInfo.Delete(true);
 }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:12,代码来源:HandleUserconfigCommand.cs

示例9: Init

        public Repository Init(IAbsoluteDirectoryPath folder, IReadOnlyCollection<Uri> hosts,
            Dictionary<string, object> opts = null) {
            Contract.Requires<ArgumentNullException>(folder != null);
            Contract.Requires<ArgumentNullException>(hosts != null);

            if (opts == null)
                opts = new Dictionary<string, object>();

            var rsyncFolder = folder.GetChildDirectoryWithName(Repository.RepoFolderName);
            if (rsyncFolder.Exists)
                throw new Exception("Already appears to be a repository");

            var packFolder = Path.Combine(opts.ContainsKey("pack_path")
                ? ((string) opts["pack_path"])
                : rsyncFolder.ToString(),
                Repository.PackFolderName).ToAbsoluteDirectoryPath();

            var configFile = rsyncFolder.GetChildFileWithName(Repository.ConfigFileName);
            var wdVersionFile = rsyncFolder.GetChildFileWithName(Repository.VersionFileName);
            var packVersionFile = packFolder.GetChildFileWithName(Repository.VersionFileName);

            this.Logger().Info("Initializing {0}", folder);
            rsyncFolder.MakeSurePathExists();
            packFolder.MakeSurePathExists();

            var config = new RepoConfig {Hosts = hosts.ToArray()};

            if (opts.ContainsKey("pack_path"))
                config.PackPath = (string) opts["pack_path"];

            if (opts.ContainsKey("include"))
                config.Include = (string[]) opts["include"];

            if (opts.ContainsKey("exclude"))
                config.Exclude = (string[]) opts["exclude"];

            var guid = opts.ContainsKey("required_guid")
                ? (string) opts["required_guid"]
                : Guid.NewGuid().ToString();

            var packVersion = new RepoVersion {Guid = guid};
            if (opts.ContainsKey("archive_format"))
                packVersion.ArchiveFormat = (string) opts["archive_format"];

            var wdVersion = YamlExtensions.NewFromYaml<RepoVersion>(packVersion.ToYaml());

            config.SaveYaml(configFile);
            packVersion.SaveYaml(packVersionFile);
            wdVersion.SaveYaml(wdVersionFile);

            return TryGetRepository(folder.ToString(), opts, rsyncFolder.ToString());
        }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:52,代码来源:RepositoryFactory.cs

示例10: GetRepoPath

 public IAbsoluteDirectoryPath GetRepoPath(string repoDirectory, IAbsoluteDirectoryPath directory,
     bool local = false) {
     if (string.IsNullOrWhiteSpace(repoDirectory)) {
         repoDirectory = directory.GetChildDirectoryWithName(Repository.DefaultRepoRootDirectory).ToString();
         if (!Directory.Exists(repoDirectory)) {
             var dir = Tools.FileUtil.FindPathInParents(directory.ToString(), Repository.DefaultRepoRootDirectory);
             if (dir != null && Directory.Exists(dir))
                 repoDirectory = dir;
             else if (local)
                 repoDirectory = directory.ToString();
         }
     }
     return Legacy.SixSync.Repository.RepoTools.GetRootedPath(repoDirectory);
 }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:14,代码来源:PackageFactory.cs

示例11: GetMod

        public async Task GetMod(GroupContent mod, IAbsoluteDirectoryPath destination, IAbsoluteDirectoryPath packPath,
            StatusRepo status, IAuthProvider provider, bool force = false) {
            var folder = destination.GetChildDirectoryWithName(mod.PackageName);

            if (!folder.Exists) {
                await InstallNew(mod, provider, GetOpts(packPath, status, mod), folder).ConfigureAwait(false);
                return;
            }

            var rsyncDir = folder.GetChildDirectoryWithName(Repository.RepoFolderName);
            if (!force && rsyncDir.Exists && IsRightVersion(rsyncDir, mod))
                return;
            await UpdateExisting(mod, provider, rsyncDir, folder, GetOpts(packPath, status, mod)).ConfigureAwait(false);
        }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:14,代码来源:Group.cs

示例12: HandleUserConfigPath

        void HandleUserConfigPath(IAbsoluteDirectoryPath dir, IAbsoluteDirectoryPath userConfigPath) {
            var files = userConfigPath.DirectoryInfo.EnumerateFiles();
            var directories = userConfigPath.DirectoryInfo.EnumerateDirectories();
            var hasFiles = files.Any();
            var hasDirectories = directories.Any();
            if (hasFiles && hasDirectories) {
                throw new NotSupportedException(
                    "The userconfig folder contains both files and folders, unable to detect what type it is");
            }

            var storePath = dir.GetChildDirectoryWithName("store");
            if (hasFiles)
                HandleUserconfigFiles(userConfigPath, storePath, files);
            else
                HandleUserconfigDirectories(userConfigPath, storePath, directories);
        }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:16,代码来源:HandleUserconfigCommand.cs

示例13: GetMod

        // TODO: localOnly if no update available? - so for local diagnose etc..
        public async Task GetMod(string name, IAbsoluteDirectoryPath destination, IAbsoluteDirectoryPath packPath,
            StatusRepo status, bool force = false) {
            var mod = GetMod(name);
            var folder = destination.GetChildDirectoryWithName(mod.Key);

            var config = GetOpts(packPath, status, mod);
            if (!folder.Exists) {
                var opts = new SyncOptions();
                config(opts);
                await
                    Repository.Factory.Clone(opts.Hosts, folder.ToString(), config)
                        .ConfigureAwait(false);
                return;
            }

            var rsyncDir = folder.GetChildDirectoryWithName(Repository.RepoFolderName);
            if (!force && rsyncDir.Exists && IsRightVersion(rsyncDir, mod))
                return;

            var repo = GetRepo(rsyncDir, folder, config);
            await repo.Update(config).ConfigureAwait(false);
        }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:23,代码来源:CustomRepo.cs

示例14: Init

        internal Repository Init(IAbsoluteDirectoryPath folder, IReadOnlyCollection<Uri> hosts, SyncOptions opts) {
            var rsyncFolder = folder.GetChildDirectoryWithName(Repository.RepoFolderName);
            if (rsyncFolder.Exists)
                throw new Exception("Already appears to be a repository");

            var packFolder = GetPackFolder(opts, rsyncFolder);
            var configFile = rsyncFolder.GetChildFileWithName(Repository.ConfigFileName);
            var wdVersionFile = rsyncFolder.GetChildFileWithName(Repository.VersionFileName);
            var packVersionFile = packFolder.GetChildFileWithName(Repository.VersionFileName);

            this.Logger().Info("Initializing {0}", folder);
            rsyncFolder.MakeSurePathExists();
            packFolder.MakeSurePathExists();

            var config = new RepoConfig { Hosts = hosts.ToList() };

            config.PackPath = opts.PackPath?.ToString();

            if (opts.Include != null)
                config.Include = opts.Include;

            if (opts.Exclude != null)
                config.Include = opts.Exclude;

            var guid = opts.RequiredGuid ?? Guid.NewGuid().ToString();

            var packVersion = new RepoVersion { Guid = guid };
            if (opts.ArchiveFormat != null)
                packVersion.ArchiveFormat = (string)opts.ArchiveFormat;

            var wdVersion = SyncEvilGlobal.Yaml.NewFromYaml<RepoVersion>(packVersion.ToYaml());

            SyncEvilGlobal.Yaml.ToYamlFile(config, configFile);
            SyncEvilGlobal.Yaml.ToYamlFile(packVersion, packVersionFile);
            SyncEvilGlobal.Yaml.ToYamlFile(wdVersion, wdVersionFile);

            return TryGetRepository(folder, opts, rsyncFolder);
        }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:38,代码来源:RepositoryFactory.cs

示例15: ProcessPbo

 void ProcessPbo(string pboFile, IAbsoluteDirectoryPath tempPath, IAbsoluteDirectoryPath destination) {
     var d = tempPath.GetChildDirectoryWithName(Path.GetFileNameWithoutExtension(pboFile));
     using (new TmpDirectory(d)) {
         _pboTools.RunExtractPboWithParameters(pboFile.ToAbsoluteFilePath(), tempPath,
             "RYDPK");
         MakePbo(d, destination);
     }
 }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:8,代码来源:IronFrontInstaller.cs


注:本文中的IAbsoluteDirectoryPath.GetChildDirectoryWithName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。