本文整理汇总了C#中LiveSplit.Model.LiveSplitState.FixTimingMethodFromRuleset方法的典型用法代码示例。如果您正苦于以下问题:C# LiveSplitState.FixTimingMethodFromRuleset方法的具体用法?C# LiveSplitState.FixTimingMethodFromRuleset怎么用?C# LiveSplitState.FixTimingMethodFromRuleset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LiveSplit.Model.LiveSplitState
的用法示例。
在下文中一共展示了LiveSplitState.FixTimingMethodFromRuleset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
private void Init(string splitsPath = null, string layoutPath = null)
{
SetWindowTitle();
SpeedrunCom.Authenticator = new SpeedrunComOAuthForm();
GlobalCache = new GraphicsCache();
Invalidator = new Invalidator(this);
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
ComponentManager.BasePath = BasePath;
SpeedRunsLiveAPI.Instance.RacesRefreshed += SRL_RacesRefreshed;
SpeedRunsLiveAPI.Instance.RefreshRacesListAsync();
CurrentState = new LiveSplitState(null, this, null, null, null);
ComparisonGeneratorsFactory = new StandardComparisonGeneratorsFactory();
Model = new DoubleTapPrevention(new TimerModel());
RunFactory = new StandardFormatsRunFactory();
RunSaver = new XMLRunSaver();
LayoutSaver = new XMLLayoutSaver();
SettingsSaver = new XMLSettingsSaver();
LoadSettings();
UpdateRecentSplits();
UpdateRecentLayouts();
InTimerOnlyMode = false;
var timerOnlyRun = new StandardRunFactory().Create(ComparisonGeneratorsFactory);
IRun run = timerOnlyRun;
try
{
if (!string.IsNullOrEmpty(splitsPath))
{
run = LoadRunFromFile(splitsPath, TimingMethod.RealTime);
}
else if (Settings.RecentSplits.Count > 0)
{
var lastSplitFile = Settings.RecentSplits.Last();
if (!string.IsNullOrEmpty(lastSplitFile.Path))
{
run = LoadRunFromFile(lastSplitFile.Path, lastSplitFile.LastTimingMethod);
CurrentState.CurrentTimingMethod = lastSplitFile.LastTimingMethod;
}
}
}
catch (Exception e)
{
Log.Error(e);
}
run.FixSplits();
CurrentState.Run = run;
CurrentState.Settings = Settings;
try
{
if (!string.IsNullOrEmpty(layoutPath))
{
Layout = LoadLayoutFromFile(layoutPath);
}
else
{
if (Settings.RecentLayouts.Count > 0
&& !string.IsNullOrEmpty(Settings.RecentLayouts.Last()))
{
Layout = LoadLayoutFromFile(Settings.RecentLayouts.Last());
}
else if (run == timerOnlyRun)
{
Layout = new TimerOnlyLayoutFactory().Create(CurrentState);
InTimerOnlyMode = true;
}
else
{
Layout = new StandardLayoutFactory().Create(CurrentState);
}
}
}
catch (Exception e)
{
Log.Error(e);
Layout = new StandardLayoutFactory().Create(CurrentState);
}
CurrentState.LayoutSettings = Layout.Settings;
CreateAutoSplitter();
CurrentState.FixTimingMethodFromRuleset();
SwitchComparisonGenerators();
SwitchComparison(Settings.LastComparison);
Model.CurrentState = CurrentState;
CurrentState.OnReset += CurrentState_OnReset;
CurrentState.OnStart += CurrentState_OnStart;
CurrentState.OnSplit += CurrentState_OnSplit;
//.........这里部分代码省略.........