• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IAbsoluteDirectoryPath类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Create

 public static async Task<PackageManager> Create(Repository repo, IAbsoluteDirectoryPath workDir,
     bool createWhenNotExisting = false,
     string remote = null) {
     var pm = new PackageManager(repo, workDir, createWhenNotExisting, remote);
     await repo.RefreshRemotes().ConfigureAwait(false);
     return pm;
 }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:7,代码来源:PackageManager.cs


示例2: ExistingMods

 static IEnumerable<IAbsoluteDirectoryPath> ExistingMods(IAbsoluteDirectoryPath[] paths, params string[] mods) {
     return paths.Any()
         ? mods.Select(
             x => paths.Select(path => path.GetChildDirectoryWithName(x)).FirstOrDefault(p => p.Exists))
             .Where(x => x != null)
         : Enumerable.Empty<IAbsoluteDirectoryPath>();
 }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:7,代码来源:Arma2OaGame.cs


示例3: GetNetEntryFilePath

 private static IAbsoluteFilePath GetNetEntryFilePath(IAbsoluteDirectoryPath netEntryPath, string asName) {
     var en = netEntryPath ?? AppContext.BaseDirectory.ToAbsoluteDirectoryPath();
     var dll = en.GetChildFileWithName(asName + ".dll");
     var netEntryFilePath = dll.Exists ? dll : en.GetChildFileWithName(asName + ".exe");
         //_entryAssembly.Location.ToAbsoluteFilePath();
     return netEntryFilePath;
 }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:7,代码来源:AssemblyLoader.cs


示例4: OpenRepositoryWithRetry

        public Repository OpenRepositoryWithRetry(IAbsoluteDirectoryPath path, bool createWhenNotExisting = false,
            Action failAction = null) {
            if (createWhenNotExisting && !path.Exists)
                return new Repository(path, createWhenNotExisting);

            using (var autoResetEvent = new AutoResetEvent(false))
            using (var fileSystemWatcher =
                new FileSystemWatcher(path.ToString(), "*.lock") {
                    EnableRaisingEvents = true
                }) {
                var lockFile = path.GetChildFileWithName(Repository.LockFile);
                var fp = Path.GetFullPath(lockFile.ToString());
                fileSystemWatcher.Deleted +=
                    (o, e) => {
                        if (Path.GetFullPath(e.FullPath) == fp)
                            autoResetEvent.Set();
                    };

                while (true) {
                    using (var timer = UnlockTimer(lockFile, autoResetEvent)) {
                        try {
                            return new Repository(path, createWhenNotExisting);
                        } catch (RepositoryLockException) {
                            if (failAction != null)
                                failAction();
                            timer.Start();
                            autoResetEvent.WaitOne();
                            lock (timer)
                                timer.Stop();
                            autoResetEvent.Reset();
                        }
                    }
                }
            }
        }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:35,代码来源:RepositoryFactory.cs


示例5: ContentPaths

        public ContentPaths(IAbsoluteDirectoryPath path, IAbsoluteDirectoryPath repositoryPath) {
            Contract.Requires<ArgumentNullException>(path != null);
            Contract.Requires<ArgumentNullException>(repositoryPath != null);

            Path = path;
            RepositoryPath = repositoryPath;
        }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:7,代码来源:ContentPaths.cs


示例6: Import

        public Package Import(Repository repo, IAbsoluteDirectoryPath workDir, IAbsoluteFilePath packageFilePath) {
            var metaData = Package.Load(packageFilePath);
            var package = new Package(workDir, metaData, repo);
            package.Commit(metaData.GetVersionInfo());

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


示例7: UpgradeOrInstall

        const int WM_USER = 0x0400; //http://msdn.microsoft.com/en-us/library/windows/desktop/ms644931(v=vs.85).aspx

        public async Task UpgradeOrInstall(IAbsoluteDirectoryPath destination, Settings settings,
            params IAbsoluteFilePath[] files) {
            var theShell = GetTheShell(destination, files);
            if (theShell.Exists)
                await Uninstall(destination, settings, files).ConfigureAwait(false);
            await Install(destination, settings, files).ConfigureAwait(false);
        }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:9,代码来源:ExplorerExtensionInstaller.cs


示例8: Create

 public static async Task<BundleManager> Create(Repository repo, IAbsoluteDirectoryPath workDir,
     bool createWhenNotExisting = false,
     string remote = null) {
     var packageManager =
         await PackageManager.Create(repo, workDir, createWhenNotExisting, remote).ConfigureAwait(false);
     return new BundleManager(packageManager);
 }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:7,代码来源:BundleManager.cs


示例9: Enumerate

 public IEnumerable<string> Enumerate(IAbsoluteDirectoryPath path) {
     Contract.Requires<ArgumentNullException>(path != null);
     return Tools.FileUtil.GetFiles(path, "*.bisign")
         .Select(GetSignatureFromFileName).Where(x => !string.IsNullOrWhiteSpace(x))
         .Select(x => x.ToLower())
         .Distinct();
 }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:7,代码来源:EnumerateSignatures.cs


示例10: 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


示例11: ContentEngineContent

 public ContentEngineContent(Guid networkId, Guid id, bool isInstalled, IAbsoluteDirectoryPath path, Guid gameId) {
     NetworkId = networkId;
     Id = id;
     IsInstalled = isInstalled;
     PathInternal = path;
     GameId = gameId;
 }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:7,代码来源:IContentEngineContent.cs


示例12: TryResolve

			public VariablePathResolvingStatus TryResolve(IEnumerable<KeyValuePair<string, string>> variables,
				out IAbsoluteDirectoryPath resolvedPath, out IReadOnlyList<string> unresolvedVariables)
			{
				Argument.IsNotNull(nameof(variables), variables);

				string path;

				if (!TryResolve(variables, out path, out unresolvedVariables))
				{
					resolvedPath = null;

					return VariablePathResolvingStatus.UnresolvedVariable;
				}

				if (!path.IsValidAbsoluteDirectoryPath())
				{
					resolvedPath = null;

					return VariablePathResolvingStatus.CannotConvertToAbsolutePath;
				}

				resolvedPath = path.ToAbsoluteDirectoryPath();

				return VariablePathResolvingStatus.Success;
			}
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:25,代码来源:PathHelpers.VariableDirectoryPath.cs


示例13: TryCheckUac

        async Task<bool> TryCheckUac(IAbsoluteDirectoryPath mp, IAbsoluteFilePath path) {
            Exception ex;
            try {
                mp.MakeSurePathExists();
                if (path.Exists)
                    File.Delete(path.ToString());
                using (File.CreateText(path.ToString())) {}
                File.Delete(path.ToString());
                return false;
            } catch (UnauthorizedAccessException e) {
                ex = e;
            } catch (Exception e) {
                this.Logger().FormattedWarnException(e);
                return false;
            }

            var report = await UserErrorHandler.HandleUserError(new UserErrorModel("Restart the application elevated?",
                             $"The application failed to write to the path, probably indicating permission issues\nWould you like to restart the application Elevated?\n\n {mp}",
                             RecoveryCommands.YesNoCommands, null, ex)) == RecoveryOptionResultModel.RetryOperation;

            if (!report)
                return false;
            RestartWithUacInclEnvironmentCommandLine();
            return true;
        }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:25,代码来源:Restarter.cs


示例14: PackageManager

        public PackageManager(Repository repo, IAbsoluteDirectoryPath workDir, bool createWhenNotExisting = false,
            string remote = null) {
            Contract.Requires<ArgumentNullException>(repo != null);
            Contract.Requires<ArgumentNullException>(workDir != null);
            WorkDir = workDir;
            Repo = repo;
            StatusRepo = new StatusRepo();
            Settings = new PackageManagerSettings();

            Repository.Factory.HandlePathRequirements(WorkDir, Repo);

            if (!WorkDir.Exists) {
                if (!createWhenNotExisting)
                    throw new Exception("Workdir doesnt exist");
                WorkDir.MakeSurePathExists();
            }

            if (!string.IsNullOrWhiteSpace(remote)) {
                var config =
                    Repository.DeserializeJson<RepositoryConfigDto>(
                        FetchString(Tools.Transfer.JoinUri(new Uri(remote), "config.json")));
                if (config.Uuid == Guid.Empty)
                    throw new Exception("Invalid remote, does not contain an UUID");
                Repo.AddRemote(config.Uuid, remote);
                Repo.Save();
            }

            Repository.Log("Opening repository at: {0}. Working directory at: {1}", Repo.RootPath, WorkDir);
            _remote = remote;
        }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:30,代码来源:PackageManager.cs


示例15: 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


示例16: CheckoutBundles

        async Task CheckoutBundles(IAbsoluteDirectoryPath path, Repository repo, string[] packages) {
            var pm = await BundleManager.Create(repo, path).ConfigureAwait(false);
            ConfirmOperationMode(pm.Repo, 2);

            var scope = BundleScope.All;
            if (!string.IsNullOrWhiteSpace(Scope)) {
                if (!Enum.TryParse(Scope, true, out scope))
                    throw new ConsoleHelpAsException("Invalid scope: " + Scope);
            }

            System.Console.WriteLine("Querying Bundles: {0}. Scope: {1}, IncludeOptional: {2}. Additional: {3}",
                String.Join(", ", packages), scope, IncludeOptional, Additional);

            Package[] packs;
            using (new ConsoleProgress(pm.PackageManager.StatusRepo)) {
                packs = await pm.Checkout(new Bundle("selected") {
                    Dependencies =
                        packages.Select(x => new Dependency(x))
                            .ToDictionary(x => x.Name, x => x.GetConstraints()),
                    Required =
                        Additional == null
                            ? new Dictionary<string, string>()
                            : Additional.Split(',')
                                .Select(x => new Dependency(x))
                                .ToDictionary(x => x.Name, x => x.GetConstraints())
                }, IncludeOptional, scope, UseVersionedPackageFolders).ConfigureAwait(false);
            }

            System.Console.WriteLine("\nSuccesfully checked out {0} packages",
                string.Join(", ", packs.Count()));
        }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:31,代码来源:CheckoutCommand.cs


示例17: IsRightVersion

        bool IsRightVersion(IAbsoluteDirectoryPath rsyncDir, KeyValuePair<string, SixRepoModDto> mod) {
            var versionFile = rsyncDir.GetChildFileWithName(Repository.VersionFileName);
            if (!versionFile.Exists)
                return false;

            var repoInfo = TryReadRepoFile(versionFile);
            return (repoInfo != null) && (repoInfo.Guid == mod.Value.Guid) && (repoInfo.Version == mod.Value.Version);
        }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:8,代码来源:CustomRepo.cs


示例18: ProcessDirectory

 void ProcessDirectory(ProcessDirectoryOrFileParams spec, IAbsoluteDirectoryPath directory) {
     if (spec.OnlyWhenMissing) {
         ProcessDirectoryOnlyMissing(spec, directory);
         return;
     }
     var biKeyPair = GetKey(spec, directory);
     _biSigner.SignFolder(directory, biKeyPair.PrivateFile, spec.RepackIfFailed);
 }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:8,代码来源:AddonSigner.cs


示例19: GetRelativeDirectory

        public static string GetRelativeDirectory(this IAbsoluteDirectoryPath path,
            IAbsoluteDirectoryPath possibleRoot) {
            if (path.Equals(possibleRoot) || !path.CanGetRelativePathFrom(possibleRoot) ||
                !path.IsRootedIn(possibleRoot))
                return path.ToString();

            return path.GetRelativePathFrom(possibleRoot).Join();
        }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:8,代码来源:DirectoryExtensions.cs


示例20: HandleKeyParams

 public HandleKeyParams(IAbsoluteDirectoryPath keyPath, string prefix, bool copyKey,
     IAbsoluteDirectoryPath directory, IAbsoluteFilePath key) {
     KeyPath = keyPath;
     Prefix = prefix;
     CopyKey = copyKey;
     Directory = directory;
     Key = key;
 }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:8,代码来源:BiSigner.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IAbsoluteFilePath类代码示例发布时间:2022-05-24
下一篇:
C# IAVR32Visitor类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap