本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}