本文整理汇总了C#中IRun.IsAutoSplitterActive方法的典型用法代码示例。如果您正苦于以下问题:C# IRun.IsAutoSplitterActive方法的具体用法?C# IRun.IsAutoSplitterActive怎么用?C# IRun.IsAutoSplitterActive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRun
的用法示例。
在下文中一共展示了IRun.IsAutoSplitterActive方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Save
public void Save(IRun run, Stream stream)
{
var document = new XmlDocument();
XmlNode docNode = document.CreateXmlDeclaration("1.0", "UTF-8", null);
document.AppendChild(docNode);
var parent = document.CreateElement("Run");
parent.Attributes.Append(SettingsHelper.ToAttribute(document, "version", "1.5.0"));
document.AppendChild(parent);
parent.AppendChild(SettingsHelper.CreateImageElement(document, "GameIcon", run.GameIcon));
parent.AppendChild(SettingsHelper.ToElement(document, "GameName", run.GameName));
parent.AppendChild(SettingsHelper.ToElement(document, "CategoryName", run.CategoryName));
parent.AppendChild(SettingsHelper.ToElement(document, "Offset", run.Offset));
parent.AppendChild(SettingsHelper.ToElement(document, "AttemptCount", run.AttemptCount));
var runHistory = document.CreateElement("AttemptHistory");
foreach (var attempt in run.AttemptHistory)
{
runHistory.AppendChild(attempt.ToXml(document));
}
parent.AppendChild(runHistory);
var segmentElement = document.CreateElement("Segments");
parent.AppendChild(segmentElement);
var bf = new BinaryFormatter();
foreach (var segment in run)
{
var splitElement = document.CreateElement("Segment");
segmentElement.AppendChild(splitElement);
splitElement.AppendChild(SettingsHelper.ToElement(document, "Name", segment.Name));
splitElement.AppendChild(SettingsHelper.CreateImageElement(document, "Icon", segment.Icon));
var splitTimes = document.CreateElement("SplitTimes");
foreach (var comparison in run.CustomComparisons)
{
var splitTime = segment.Comparisons[comparison].ToXml(document, "SplitTime");
splitTime.Attributes.Append(SettingsHelper.ToAttribute(document, "name", comparison));
splitTimes.AppendChild(splitTime);
}
splitElement.AppendChild(splitTimes);
splitElement.AppendChild(segment.BestSegmentTime.ToXml(document, "BestSegmentTime"));
var history = document.CreateElement("SegmentHistory");
foreach (var historySegment in segment.SegmentHistory)
{
history.AppendChild(historySegment.ToXml(document));
}
splitElement.AppendChild(history);
}
var autoSplitterSettings = document.CreateElement("AutoSplitterSettings");
if (run.IsAutoSplitterActive())
autoSplitterSettings.InnerXml = run.AutoSplitter.Component.GetSettings(document).InnerXml;
parent.AppendChild(autoSplitterSettings);
document.Save(stream);
}
示例2: Save
public void Save(IRun run, Stream stream)
{
var document = new XmlDocument();
XmlNode docNode = document.CreateXmlDeclaration("1.0", "UTF-8", null);
document.AppendChild(docNode);
var parent = document.CreateElement("Run");
parent.Attributes.Append(SettingsHelper.ToAttribute(document, "version", "1.6.0"));
document.AppendChild(parent);
parent.AppendChild(SettingsHelper.CreateImageElement(document, "GameIcon", run.GameIcon));
parent.AppendChild(SettingsHelper.ToElement(document, "GameName", run.GameName));
parent.AppendChild(SettingsHelper.ToElement(document, "CategoryName", run.CategoryName));
parent.AppendChild(SettingsHelper.ToElement(document, "Offset", run.Offset));
parent.AppendChild(SettingsHelper.ToElement(document, "AttemptCount", run.AttemptCount));
var runHistory = document.CreateElement("AttemptHistory");
foreach (var attempt in run.AttemptHistory)
{
runHistory.AppendChild(attempt.ToXml(document));
}
parent.AppendChild(runHistory);
var segmentElement = document.CreateElement("Segments");
parent.AppendChild(segmentElement);
var bf = new BinaryFormatter();
foreach (var segment in run)
{
var splitElement = document.CreateElement("Segment");
segmentElement.AppendChild(splitElement);
splitElement.AppendChild(SettingsHelper.ToElement(document, "Name", segment.Name));
splitElement.AppendChild(SettingsHelper.CreateImageElement(document, "Icon", segment.Icon));
var splitTimes = document.CreateElement("SplitTimes");
foreach (var comparison in run.CustomComparisons)
{
var splitTime = segment.Comparisons[comparison].ToXml(document, "SplitTime");
splitTime.Attributes.Append(SettingsHelper.ToAttribute(document, "name", comparison));
splitTimes.AppendChild(splitTime);
}
splitElement.AppendChild(splitTimes);
splitElement.AppendChild(segment.BestSegmentTime.ToXml(document, "BestSegmentTime"));
var history = document.CreateElement("SegmentHistory");
foreach (var historySegment in segment.SegmentHistory)
{
history.AppendChild(historySegment.ToXml(document));
}
splitElement.AppendChild(history);
}
var autoSplitterSettings = document.CreateElement("AutoSplitterSettings");
if (run.IsAutoSplitterActive())
autoSplitterSettings.InnerXml = run.AutoSplitter.Component.GetSettings(document).InnerXml;
parent.AppendChild(autoSplitterSettings);
var metadata = document.CreateElement("Metadata");
var runElement = document.CreateElement("Run");
runElement.Attributes.Append(SettingsHelper.ToAttribute(document, "id", run.Metadata.RunID ?? string.Empty));
metadata.AppendChild(runElement);
var platform = SettingsHelper.ToElement(document, "Platform", run.Metadata.PlatformName ?? string.Empty);
platform.Attributes.Append(SettingsHelper.ToAttribute(document, "usesEmulator", run.Metadata.UsesEmulator));
metadata.AppendChild(platform);
metadata.AppendChild(SettingsHelper.ToElement(document, "Region", run.Metadata.RegionName ?? string.Empty));
var variables = document.CreateElement("Variables");
foreach (var variable in run.Metadata.VariableValueNames)
{
var variableElement = SettingsHelper.ToElement(document, "Variable", variable.Value ?? string.Empty);
variableElement.Attributes.Append(SettingsHelper.ToAttribute(document, "name", variable.Key ?? string.Empty));
variables.AppendChild(variableElement);
}
metadata.AppendChild(variables);
parent.AppendChild(metadata);
document.Save(stream);
}
示例3: Save
public void Save(IRun run, Stream stream)
{
var document = new XmlDocument();
XmlNode docNode = document.CreateXmlDeclaration("1.0", "UTF-8", null);
document.AppendChild(docNode);
var parent = document.CreateElement("Run");
var version = document.CreateAttribute("version");
version.Value = "1.5.0";
parent.Attributes.Append(version);
document.AppendChild(parent);
var gameIcon = CreateImageElement(document, "GameIcon", run.GameIcon);
parent.AppendChild(gameIcon);
var gameName = document.CreateElement("GameName");
gameName.InnerText = run.GameName;
parent.AppendChild(gameName);
var categoryName = document.CreateElement("CategoryName");
categoryName.InnerText = run.CategoryName;
parent.AppendChild(categoryName);
var offset = document.CreateElement("Offset");
offset.InnerText = run.Offset.ToString();
parent.AppendChild(offset);
var attemptCount = document.CreateElement("AttemptCount");
attemptCount.InnerText = run.AttemptCount.ToString();
parent.AppendChild(attemptCount);
var runHistory = document.CreateElement("AttemptHistory");
foreach (var attempt in run.AttemptHistory)
{
runHistory.AppendChild(attempt.ToXml(document));
}
parent.AppendChild(runHistory);
var segmentElement = document.CreateElement("Segments");
parent.AppendChild(segmentElement);
var bf = new BinaryFormatter();
foreach (var segment in run)
{
var splitElement = document.CreateElement("Segment");
segmentElement.AppendChild(splitElement);
var name = document.CreateElement("Name");
name.InnerText = segment.Name;
splitElement.AppendChild(name);
var icon = CreateImageElement(document, "Icon", segment.Icon);
splitElement.AppendChild(icon);
var splitTimes = document.CreateElement("SplitTimes");
foreach (var comparison in run.CustomComparisons)
{
var splitTime = segment.Comparisons[comparison].ToXml(document, "SplitTime");
var comparisonName = document.CreateAttribute("name");
comparisonName.Value = comparison;
splitTime.Attributes.Append(comparisonName);
splitTimes.AppendChild(splitTime);
}
splitElement.AppendChild(splitTimes);
var goldSplit = segment.BestSegmentTime.ToXml(document, "BestSegmentTime");
splitElement.AppendChild(goldSplit);
var history = document.CreateElement("SegmentHistory");
foreach (var historySegment in segment.SegmentHistory)
{
history.AppendChild(historySegment.ToXml(document));
}
splitElement.AppendChild(history);
}
var autoSplitterSettings = document.CreateElement("AutoSplitterSettings");
if (run.IsAutoSplitterActive())
autoSplitterSettings.InnerXml = run.AutoSplitter.Component.GetSettings(document).InnerXml;
parent.AppendChild(autoSplitterSettings);
document.Save(stream);
}