本文整理汇总了C#中IGameMode.GetPluginOrderLogSerializer方法的典型用法代码示例。如果您正苦于以下问题:C# IGameMode.GetPluginOrderLogSerializer方法的具体用法?C# IGameMode.GetPluginOrderLogSerializer怎么用?C# IGameMode.GetPluginOrderLogSerializer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGameMode
的用法示例。
在下文中一共展示了IGameMode.GetPluginOrderLogSerializer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeServices
//.........这里部分代码省略.........
Trace.TraceInformation("Initializing Install Log...");
Trace.Indent();
Trace.TraceInformation("Checking if upgrade is required...");
InstallLogUpgrader iluUgrader = new InstallLogUpgrader();
string strLogPath = string.Empty;
try
{
strLogPath = Path.Combine(p_gmdGameMode.GameModeEnvironmentInfo.InstallInfoDirectory, "InstallLog.xml");
}
catch (ArgumentNullException)
{
p_vwmErrorMessage = new ViewMessage("Unable to retrieve critical paths from the config file." + Environment.NewLine + "Select this game again to fix the folders setup.", null, "Config error", MessageBoxIcon.Warning);
return null;
}
if (!InstallLog.IsLogValid(strLogPath))
InstallLog.Restore(strLogPath);
if (iluUgrader.NeedsUpgrade(strLogPath))
{
if (!iluUgrader.CanUpgrade(strLogPath))
{
p_vwmErrorMessage = new ViewMessage(String.Format("{0} does not support version {1} of the Install Log.", EnvironmentInfo.Settings.ModManagerName, InstallLog.ReadVersion(strLogPath)), null, "Install Log", MessageBoxIcon.Error);
return null;
}
IBackgroundTask tskUpgrader = iluUgrader.UpgradeInstallLog(strLogPath, p_gmdGameMode.GameModeEnvironmentInfo.ModDirectory, mrgModRegistry);
m_areTaskWait.Reset();
tskUpgrader.TaskEnded += new EventHandler<TaskEndedEventArgs>(Task_TaskEnded);
OnTaskStarted(tskUpgrader);
if (tskUpgrader.IsActive)
m_areTaskWait.WaitOne();
tskUpgrader.TaskEnded -= new EventHandler<TaskEndedEventArgs>(Task_TaskEnded);
if (tskUpgrader.Status != TaskStatus.Complete)
{
string strDetails = (string)(tskUpgrader.ReturnValue ?? null);
p_vwmErrorMessage = new ViewMessage("Install Log was not upgraded.", strDetails, "Install Log", MessageBoxIcon.Error);
return null;
}
}
IInstallLog ilgInstallLog = InstallLog.Initialize(mrgModRegistry, p_gmdGameMode.GameModeEnvironmentInfo.ModDirectory, strLogPath);
Trace.Unindent();
Trace.TraceInformation("Initializing Plugin Management Services...");
Trace.Indent();
PluginRegistry prgPluginRegistry = null;
IPluginOrderLog polPluginOrderLog = null;
ActivePluginLog aplPluginLog = null;
IPluginManager pmgPluginManager = null;
if (!p_gmdGameMode.UsesPlugins)
Trace.TraceInformation("Not required.");
else
{
Trace.TraceInformation("Initializing Plugin Registry...");
Trace.Indent();
prgPluginRegistry = PluginRegistry.DiscoverManagedPlugins(p_gmdGameMode.GetPluginFactory(), p_gmdGameMode.GetPluginDiscoverer());
Trace.TraceInformation("Found {0} managed plugins.", prgPluginRegistry.RegisteredPlugins.Count);
Trace.Unindent();
Trace.TraceInformation("Initializing Plugin Order Log...");
Trace.Indent();
polPluginOrderLog = PluginOrderLog.Initialize(prgPluginRegistry, p_gmdGameMode.GetPluginOrderLogSerializer(), p_gmdGameMode.GetPluginOrderValidator());
Trace.Unindent();
Trace.TraceInformation("Initializing Active Plugin Log...");
Trace.Indent();
aplPluginLog = ActivePluginLog.Initialize(prgPluginRegistry, p_gmdGameMode.GetActivePluginLogSerializer(polPluginOrderLog));
Trace.Unindent();
Trace.TraceInformation("Initializing Plugin Manager...");
Trace.Indent();
pmgPluginManager = PluginManager.Initialize(p_gmdGameMode, prgPluginRegistry, aplPluginLog, polPluginOrderLog, p_gmdGameMode.GetPluginOrderValidator());
Trace.Unindent();
}
Trace.Unindent();
Trace.TraceInformation("Initializing Activity Monitor...");
Trace.Indent();
DownloadMonitor dmtMonitor = new DownloadMonitor();
Trace.Unindent();
Trace.TraceInformation("Initializing Activate Mods Monitor...");
Trace.Indent();
ActivateModsMonitor ammMonitor = new ActivateModsMonitor();
Trace.Unindent();
Trace.TraceInformation("Initializing Mod Manager...");
Trace.Indent();
ModManager mmgModManager = ModManager.Initialize(p_gmdGameMode, EnvironmentInfo, p_mrpModRepository, dmtMonitor, ammMonitor, mfrModFormatRegistry, mrgModRegistry, p_nfuFileUtility, p_scxUIContext, ilgInstallLog, pmgPluginManager);
Trace.Unindent();
Trace.TraceInformation("Initializing Update Manager...");
Trace.Indent();
UpdateManager umgUpdateManager = new UpdateManager(p_gmdGameMode, EnvironmentInfo);
Trace.Unindent();
p_vwmErrorMessage = null;
return new ServiceManager(ilgInstallLog, aplPluginLog, polPluginOrderLog, p_mrpModRepository, mmgModManager, pmgPluginManager, dmtMonitor, ammMonitor, umgUpdateManager);
}