public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { AxisLabelStyle s = null != o ? (AxisLabelStyle)o : new AxisLabelStyle(info); s._font = (FontX)info.GetValue("Font", s); s._brush = (BrushX)info.GetValue("Brush", s); s._backgroundStyle = (IBackgroundStyle)info.GetValue("Background", s); s._automaticRotationShift = info.GetBoolean("AutoAlignment"); s._horizontalAlignment = (StringAlignment)info.GetEnum("HorzAlignment", typeof(StringAlignment)); s._verticalAlignment = (StringAlignment)info.GetEnum("VertAlignment", typeof(StringAlignment)); s._rotation = info.GetDouble("Rotation"); s._xOffset = info.GetDouble("XOffset"); s._yOffset = info.GetDouble("YOffset"); s._labelFormatting = (ILabelFormatting)info.GetValue("LabelFormat", s); s._labelFormatting.ParentObject = s; s._suppressedLabels = new SuppressedTicks() { ParentObject = s }; // Modification of StringFormat is necessary to avoid // too big spaces between successive words s._stringFormat = (StringFormat)StringFormat.GenericTypographic.Clone(); s._stringFormat.FormatFlags |= StringFormatFlags.MeasureTrailingSpaces; return(s); }
/// <summary> /// Deserializes the XYAxisLabelStyle Version 0. /// </summary> /// <param name="obj">The empty XYAxisLabelStyle object to deserialize into.</param> /// <param name="info">The serialization info.</param> /// <param name="context">The streaming context.</param> /// <param name="selector">The deserialization surrogate selector.</param> /// <returns>The deserialized XYAxisLabelStyle.</returns> public object SetObjectData(object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.ISurrogateSelector selector) { AxisLabelStyle s = (AxisLabelStyle)obj; s._font = (Font)info.GetValue("Font", typeof(Font)); return(s); }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { AxisLabelStyle s = null != o ? (AxisLabelStyle)o : new AxisLabelStyle(); Edge edge = (Edge)info.GetValue("Edge", s); s._font = (Font)info.GetValue("Font", s); s.SetStringFormat(); return(s); }
public void ShowMinorLabels(Altaxo.Main.Properties.IReadOnlyPropertyBag context) { if (_minorLabelStyle == null) { MinorLabelStyle = new AxisLabelStyle(context) { CachedAxisInformation = _cachedAxisInfo } } ; }
public AxisLabelStyle(AxisLabelStyle from) { _font = null == from._font ? null : (Font)from._font.Clone(); _stringFormat = (StringFormat)from._stringFormat.Clone(); _horizontalAlignment = from._horizontalAlignment; _verticalAlignment = from._verticalAlignment; _brush = (BrushX)from._brush.Clone(); _automaticRotationShift = from._automaticRotationShift; _xOffset = from._xOffset; _yOffset = from._yOffset; _rotation = from._rotation; _backgroundStyle = null == from._backgroundStyle ? null : (IBackgroundStyle)from._backgroundStyle.Clone(); _labelFormatting = (ILabelFormatting)from._labelFormatting.Clone(); }
public void Serialize(object obj, Altaxo.Serialization.Xml.IXmlSerializationInfo info) { AxisLabelStyle s = (AxisLabelStyle)obj; info.AddValue("Font", s._font); info.AddValue("Brush", s._brush); info.AddValue("Background", s._backgroundStyle); info.AddValue("AutoAlignment", s._automaticRotationShift); info.AddEnum("HorzAlignment", s._horizontalAlignment); info.AddEnum("VertAlignment", s._verticalAlignment); info.AddValue("Rotation", s._rotation); info.AddValue("XOffset", s._xOffset); info.AddValue("YOffset", s._yOffset); info.AddValue("LabelFormat", s._labelFormatting); }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { AxisLabelStyle s = null != o ? (AxisLabelStyle)o : new AxisLabelStyle(info); var edge = (Edge)info.GetValue("Edge", s); s._font = (FontX)info.GetValue("Font", s); s._brush = new BrushX(NamedColors.Black) { ParentObject = s }; s._automaticRotationShift = true; s._suppressedLabels = new SuppressedTicks() { ParentObject = s }; s._labelFormatting = new Gdi.LabelFormatting.NumericLabelFormattingAuto() { ParentObject = s }; s.SetStringFormat(); return(s); }
public AxisLabelStyle(AxisLabelStyle from) { CopyFrom(from); }
public AxisLabelStyle(AxisLabelStyle from) { _font = null==from._font ? null : (Font)from._font.Clone(); _stringFormat = (StringFormat)from._stringFormat.Clone(); _horizontalAlignment = from._horizontalAlignment; _verticalAlignment = from._verticalAlignment; _brush = (BrushX)from._brush.Clone(); _automaticRotationShift = from._automaticRotationShift; _xOffset = from._xOffset; _yOffset = from._yOffset; _rotation = from._rotation; _backgroundStyle = null==from._backgroundStyle ? null : (IBackgroundStyle)from._backgroundStyle.Clone(); _labelFormatting = (ILabelFormatting)from._labelFormatting.Clone(); }
public bool InitializeDocument(params object[] args) { if (args.Length == 0 || !(args[0] is AxisLabelStyle)) return false; bool isFirstTime = null == _doc; _doc = (AxisLabelStyle)args[0]; Initialize(isFirstTime); return true; }
public void ShowMinorLabels(Altaxo.Main.Properties.IReadOnlyPropertyBag context) { if (_minorLabelStyle == null) MinorLabelStyle = new AxisLabelStyle(context) { CachedAxisInformation = _cachedAxisInfo }; }
/// <summary> /// Serializes XYAxisLabelStyle Version 0. /// </summary> /// <param name="obj">The XYAxisLabelStyle to serialize.</param> /// <param name="info">The serialization info.</param> /// <param name="context">The streaming context.</param> public void GetObjectData(object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { AxisLabelStyle s = (AxisLabelStyle)obj; info.AddValue("Font", s._font); }