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


C# IAbsoluteDirectoryPath.IsNotNullAndExists方法代码示例

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


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

示例1: InstallPlugin

        bool InstallPlugin(IAbsoluteDirectoryPath gamePath, IContentEngineContent mod, string plugin, bool force) {
            Contract.Requires<ArgumentNullException>(gamePath.IsNotNullAndExists(),
                "Unable to find the Game Install Directory");
            Contract.Requires<ArgumentNullException>(mod != null, "Fatal Error Occured: Mod incorrectly registered");
            Contract.Requires<ArgumentNullException>(plugin != null, "Fatal Error Occured: Plugin Path was not set");

            if (!mod.IsInstalled || !mod.PathInternal.IsNotNullAndExists())
                throw new InvalidOperationException("The mod is not installed");

            var pluginPath = mod.PathInternal.GetChildFileWithName(plugin);
            var gamePluginFolder = gamePath;

            return InstallDll(pluginPath, gamePluginFolder, force);
        }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:14,代码来源:GameFolderService.cs

示例2: InstallDll

        static bool InstallDll(IAbsoluteFilePath pluginPath, IAbsoluteDirectoryPath gamePluginFolder,
            bool force = true) {
            Contract.Requires<ArgumentNullException>(gamePluginFolder != null);
            Contract.Requires<ArgumentNullException>(pluginPath != null);

            if (!pluginPath.IsNotNullAndExists())
                throw new PathDoesntExistException(pluginPath.ToString());

            if (!gamePluginFolder.IsNotNullAndExists())
                throw new PathDoesntExistException(gamePluginFolder.ToString());

            var fullPath = gamePluginFolder.GetChildFileWithName(pluginPath.FileName);

            if (!force && fullPath.Exists)
                return false;

            return TryCopyDll(pluginPath, fullPath);
        }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:18,代码来源:GameFolderService.cs

示例3: InstallFolder

        static void InstallFolder(IAbsoluteDirectoryPath pluginPath, IAbsoluteDirectoryPath tsPluginFolder, bool force) {
            Contract.Requires<ArgumentNullException>(tsPluginFolder != null);
            Contract.Requires<ArgumentNullException>(pluginPath != null);

            if (!pluginPath.IsNotNullAndExists())
                throw new PathDoesntExistException(pluginPath.ToString());

            if (!tsPluginFolder.IsNotNullAndExists())
                throw new PathDoesntExistException(tsPluginFolder.ToString());

            TryCopyFolder(pluginPath, tsPluginFolder.GetChildDirectoryWithName(pluginPath.DirectoryName), force);
        }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:12,代码来源:TeamspeakService.cs

示例4: InstallPlugin

        bool InstallPlugin(IAbsoluteDirectoryPath tsPath, IContentEngineContent mod, string plugin, bool force) {
            Contract.Requires<ArgumentNullException>(tsPath.IsNotNullAndExists(),
                "Unable to find the Teamspeak Install Directory");
            Contract.Requires<ArgumentNullException>(mod != null, "Fatal Error Occured: Mod incorrectly registered");
            Contract.Requires<ArgumentNullException>(plugin != null, "Fatal Error Occured: Plugin Path was not set");

            if (!mod.IsInstalled || !mod.PathInternal.IsNotNullAndExists())
                throw new InvalidOperationException("The mod is not installed");

            var pluginPath = Path.Combine(mod.PathInternal.ToString(), plugin).ToAbsoluteFilePath();
            var tsPluginFolder = GetPluginPath(tsPath);

            return InstallDll(pluginPath, tsPluginFolder, force);
        }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:14,代码来源:TeamspeakService.cs


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