Esempio n. 1
0
            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);
            }
Esempio n. 2
0
            /// <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);
            }
Esempio n. 3
0
            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);
            }
Esempio n. 4
0
 public void ShowMinorLabels(Altaxo.Main.Properties.IReadOnlyPropertyBag context)
 {
     if (_minorLabelStyle == null)
     {
         MinorLabelStyle = new AxisLabelStyle(context)
         {
             CachedAxisInformation = _cachedAxisInfo
         }
     }
     ;
 }
Esempio n. 5
0
 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();
 }
Esempio n. 6
0
            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);
            }
Esempio n. 7
0
            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);
            }
Esempio n. 8
0
 public AxisLabelStyle(AxisLabelStyle from)
 {
     CopyFrom(from);
 }
Esempio n. 9
0
		public AxisLabelStyle(AxisLabelStyle from)
		{
			CopyFrom(from);
		}
Esempio n. 10
0
 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;
    }
Esempio n. 12
0
		public void ShowMinorLabels(Altaxo.Main.Properties.IReadOnlyPropertyBag context)
		{
			if (_minorLabelStyle == null)
				MinorLabelStyle = new AxisLabelStyle(context) { CachedAxisInformation = _cachedAxisInfo };
		}
Esempio n. 13
0
            /// <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);
            }