本文整理汇总了C#中GameState.IsPluginValid方法的典型用法代码示例。如果您正苦于以下问题:C# GameState.IsPluginValid方法的具体用法?C# GameState.IsPluginValid怎么用?C# GameState.IsPluginValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameState
的用法示例。
在下文中一共展示了GameState.IsPluginValid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Install
public SetupStatus Install(IWin32Window owner)
{
if (_status == SetupStatus.Installed)
return _status;
try
{
var ets2State = new GameState(Ets2, Settings.Instance.Ets2GamePath);
var atsState = new GameState(Ats, Settings.Instance.AtsGamePath);
if (!ets2State.IsPluginValid())
{
ets2State.DetectPath();
if (!ets2State.IsPathValid())
ets2State.BrowserForValidPath(owner);
ets2State.InstallPlugin();
}
if (!atsState.IsPluginValid())
{
atsState.DetectPath();
if (!atsState.IsPathValid())
atsState.BrowserForValidPath(owner);
atsState.InstallPlugin();
}
Settings.Instance.Ets2GamePath = ets2State.GamePath;
Settings.Instance.AtsGamePath = atsState.GamePath;
Settings.Instance.Save();
_status = SetupStatus.Installed;
}
catch (Exception ex)
{
Log.Error(ex);
_status = SetupStatus.Failed;
throw;
}
return _status;
}
示例2: PluginSetup
public PluginSetup()
{
try
{
Log.Info("Checking plugin DLL files...");
var ets2State = new GameState(Ets2, Settings.Instance.Ets2GamePath);
var atsState = new GameState(Ats, Settings.Instance.AtsGamePath);
if (ets2State.IsPluginValid() && atsState.IsPluginValid())
{
_status = SetupStatus.Installed;
}
else
{
_status = SetupStatus.Uninstalled;
}
}
catch (Exception ex)
{
Log.Error(ex);
_status = SetupStatus.Failed;
}
}