public override void WriteXml(XmlWriter writer) { base.WriteXml(writer); writer.WriteElementString("TapeImage", TapeImage); writer.WriteElementString("OffFlagImage", BackgroundImage); writer.WriteElementString("ForegroundImage", ForegroundImage); writer.WriteElementString("BackgroundImage", BackgroundImage); writer.WriteElementString("Tape_PosX", Tape_PosX.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("Tape_PosY", Tape_PosY.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("Tape_Width", Tape_Width.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("Tape_Height", Tape_Height.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("Tape_CenterX", Tape_CenterX.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("Tape_CenterY", Tape_CenterY.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("OffFlag_PosX", OffFlag_PosX.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("OffFlag_PosY", OffFlag_PosY.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("OffFlag_Width", OffFlag_Width.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("OffFlag_Height", OffFlag_Height.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("OffFlag_IsHidden", OffFlag_IsHidden.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("MinHorizontal", MinHorizontal.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("HorizontalTravel", HorizontalTravel.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("MinVertical", MinVertical.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("VerticalTravel", VerticalTravel.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("MinRotation", MinRotation.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("RotationTravel", RotationTravel.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("InitialHorizontal", InitialHorizontal.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("InitialVertical", InitialVertical.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("InitialRotation", InitialRotation.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("MinInputHorizontal", MinInputHorizontal.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("MaxInputHorizontal", MaxInputHorizontal.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("MinInputVertical", MinInputVertical.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("MaxInputVertical", MaxInputVertical.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("MinInputRotation", MinInputRotation.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("MaxInputRotation", MaxInputRotation.ToString(CultureInfo.InvariantCulture)); }
/// <summary> /// 持久化为XML /// </summary> /// <returns></returns> public string ToXmlStub() { StringBuilder sb = new StringBuilder(); sb.Append("<Envelope>"); sb.Append("<MinX>" + MinHorizontal.ToString("0.0000000") + "</MinX>"); sb.Append("<MinY>" + MinVertical.ToString("0.0000000") + "</MinY>"); sb.Append("<MaxX>" + MaxHorizontal.ToString("0.0000000") + "</MaxX>"); sb.Append("<MaxY>" + MaxVertical.ToString("0.0000000") + "</MaxY>"); sb.Append("</Envelope>"); return(sb.ToString()); }
public override void WriteXml(XmlWriter writer) { base.WriteXml(writer); writer.WriteElementString("DrumImage", DrumImage); writer.WriteElementString("Drum_PosX", Drum_PosX.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("Drum_PosY", Drum_PosY.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("Drum_Width", Drum_Width.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("Drum_Height", Drum_Height.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("MinVertical", MinVertical.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("VerticalTravel", VerticalTravel.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("InitialVertical", InitialVertical.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("MinInputVertical", MinInputVertical.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("MaxInputVertical", MaxInputVertical.ToString(CultureInfo.InvariantCulture)); }
/// <summary> /// 自定义的格式化输出。 /// </summary> /// <returns></returns> public override string ToString() { return("Envelope [maxX=" + MaxHorizontal.ToString("0.#####") + ", maxY=" + MaxVertical.ToString("0.#####") + ", minX=" + MinHorizontal.ToString("0.#####") + ", minY=" + MinVertical.ToString("0.#####") + "]"); }