public virtual void WriteXml(Amplitude.Xml.XmlWriter writer) { writer.WriteAttributeString("AssemblyQualifiedName", base.GetType().AssemblyQualifiedName); writer.WriteAttributeString <bool>("IsActive", this.IsActive); writer.WriteStartElement("Registers"); writer.WriteAttributeString <int>("Count", this.registers.Count); foreach (KeyValuePair <StaticString, string> keyValuePair in this.registers) { writer.WriteStartElement("Register"); writer.WriteAttributeString <StaticString>("Key", keyValuePair.Key); writer.WriteString(keyValuePair.Value); writer.WriteEndElement(); } writer.WriteEndElement(); if (this.IsActive) { writer.WriteStartElement("InstructionPanel"); writer.WriteAttributeString("Title", TutorialInstructionPanel.WaitingInstruction.Title); writer.WriteAttributeString("Content", TutorialInstructionPanel.WaitingInstruction.Content); writer.WriteAttributeString("Action", TutorialInstructionPanel.WaitingInstruction.Action); writer.WriteAttributeString <bool>("Modal", TutorialInstructionPanel.WaitingInstruction.Modal); writer.WriteAttributeString <bool>("WheelGrabber", TutorialInstructionPanel.WaitingInstruction.WheelGrabber); writer.WriteAttributeString <bool>("DisplayNextButton", TutorialInstructionPanel.WaitingInstruction.DisplayNextButton); writer.WriteAttributeString <bool>("OverNotifications", TutorialInstructionPanel.WaitingInstruction.OverNotifications); writer.WriteAttributeString <bool>("OverModals", TutorialInstructionPanel.WaitingInstruction.OverModals); writer.WriteAttributeString("WaitForPanelTypeName", TutorialInstructionPanel.WaitingInstruction.WaitForPanelTypeName); writer.WriteAttributeString("WaitForPanelName", TutorialInstructionPanel.WaitingInstruction.WaitForPanelName); writer.WriteAttributeString("Placement", TutorialInstructionPanel.WaitingInstruction.Placement.ToString()); writer.WriteEndElement(); writer.WriteStartElement("HighlightPanel"); string value = string.Empty; string value2 = string.Empty; bool value3 = true; if (this.guiService != null) { TutorialHighlightPanel guiPanel = this.guiService.GetGuiPanel <TutorialHighlightPanel>(); if (guiPanel != null && guiPanel.Target != null) { value = guiPanel.Content; value2 = guiPanel.Target.name; value3 = guiPanel.RectangularHighlight; } } writer.WriteAttributeString("Content", value); writer.WriteAttributeString("TargetName", value2); writer.WriteAttributeString <bool>("Rectangular", value3); writer.WriteEndElement(); } }
private void SaveGame(Stream stream) { if (stream == null) { throw new ArgumentNullException("stream"); } if (!stream.CanWrite) { throw new ArgumentException("stream"); } using (Amplitude.Xml.XmlWriter xmlWriter = Amplitude.Xml.XmlWriter.Create(stream)) { xmlWriter.Writer.WriteStartDocument(); xmlWriter.WriteStartElement(base.GetType().ToString()); xmlWriter.WriteAttributeString("DateTime", DateTime.Now.ToString("U")); Amplitude.Xml.Serialization.IXmlSerializable xmlSerializable = this.Game as Amplitude.Xml.Serialization.IXmlSerializable; xmlWriter.WriteElementSerializable <Amplitude.Xml.Serialization.IXmlSerializable>(ref xmlSerializable); xmlWriter.WriteEndElement(); } }