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


C# GameState.IsPluginValid方法代码示例

本文整理汇总了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;
        }
开发者ID:LibertyLocked,项目名称:ets2-telemetry-server,代码行数:41,代码来源:PluginSetup.cs

示例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;
            }
        }
开发者ID:LibertyLocked,项目名称:ets2-telemetry-server,代码行数:24,代码来源:PluginSetup.cs


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