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


C# IAbsoluteDirectoryPath类代码示例

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


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


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