public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
 {
   LabelFormattingBase s = (LabelFormattingBase)o;
   s._prefix = info.GetString("Prefix");
   s._suffix = info.GetString("Suffix");
   return s;
 }
Beispiel #2
0
			protected virtual DocumentInformation SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				DocumentInformation s = null != o ? (DocumentInformation)o : new DocumentInformation();

				s._documentIdentifier = info.GetString("Identifier");
				s._documentNotes = info.GetString("Notes");

				return s;
			}
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				AssemblyAndTypeSurrogate s = o == null ? new AssemblyAndTypeSurrogate() : (AssemblyAndTypeSurrogate)o;

				s._assemblyName = info.GetString("AssemblyName");
				s._typeName = info.GetString("TypeName");

				return s;
			}
			protected virtual AbsoluteAndRelativeFileName SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				var absoluteFilePath = info.GetString("AbsolutePath");

				var s = (o == null ? new AbsoluteAndRelativeFileName(absoluteFilePath) : (AbsoluteAndRelativeFileName)o);

				s._absoluteFileName = absoluteFilePath;
				s._relativeFileName = info.GetString("RelativePath");

				return s;
			}
Beispiel #5
0
			protected virtual CultureSettings SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				var s = null != o ? (CultureSettings)o : new CultureSettings();

				s._cultureID = info.GetInt32("CultureID");
				s._cultureName = info.GetString("CultureName");
				s._numberDecimalSeparator = info.GetString("NumberDecimalSeparator");
				s._numberGroupSeparator = info.GetString("NumberGroupSeparator");
				s.SetCachedCultureInfo();

				return s;
			}
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				DateTimeLabelFormatting s = (DateTimeLabelFormatting)o ?? new DateTimeLabelFormatting();
				info.GetBaseValueEmbedded(s, typeof(MultiLineLabelFormattingBase), parent);

				s._timeConversion = (DateTimeLabelFormatting.TimeConversion)info.GetEnum("TimeConversion", typeof(DateTimeLabelFormatting.TimeConversion));
				s._formatString = info.GetString("FormatString");
				s._showAlternateFormattingAtMidnight = info.GetBoolean("ShowAlternateFormattingAtMidnight");
				s._showAlternateFormattingAtNoon = info.GetBoolean("ShowAlternateFormattingAtNoon");
				s._formatStringAlternate = info.GetString("FormatStringAlternate");

				return s;
			}
Beispiel #7
0
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				var s = (FreeLabelFormatting)o ?? new FreeLabelFormatting();
				info.GetBaseValueEmbedded(s, typeof(FreeLabelFormatting).BaseType, parent);
				s._formatString = info.GetString("FormatString");
				return s;
			}
Beispiel #8
0
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				LinkedImageGraphic s = null != o ? (LinkedImageGraphic)o : new LinkedImageGraphic();
				info.GetBaseValueEmbedded(s, typeof(LinkedImageGraphic).BaseType, parent);
				s._imagePath = info.GetString("ImagePath");
				return s;
			}
Beispiel #9
0
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				TableScript s = null != o ? (TableScript)o : new TableScript();

				s.ScriptText = info.GetString("Text");
				return s;
			}
Beispiel #10
0
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				var s = null != o ? (WorksheetViewLayout)o : new WorksheetViewLayout();

				XmlSerializationSurrogate0 surr = new XmlSerializationSurrogate0();
				surr._TableController = s;
				if (info.CurrentElementName == "Controller")
				{
					info.OpenElement();
					surr._PathToLayout = (AbsoluteDocumentPath)info.GetValue("Layout", s);
					info.CloseElement();
				}
				else if (info.CurrentElementName == "BaseType")
				{
					info.GetString("BaseType");
					surr._PathToLayout = (AbsoluteDocumentPath)info.GetValue("Layout", s);
				}
				else
				{
					surr._PathToLayout = (AbsoluteDocumentPath)info.GetValue("Layout", s);
				}

				info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished);

				return s;
			}
Beispiel #11
0
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				SimpleTextGraphic s = null != o ? (SimpleTextGraphic)o : new SimpleTextGraphic();
				info.GetBaseValueEmbedded(s, typeof(SimpleTextGraphic).BaseType, parent);

				s._text = info.GetString("Text");
				s._font = (FontX)info.GetValue("Font", s);
				s._color = (Color)info.GetValue("Color", s);
				return s;
			}
Beispiel #12
0
			public virtual object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				ParameterSetElement s = o != null ? (ParameterSetElement)o : new ParameterSetElement();

				s.Name = info.GetString("Name");
				s.Parameter = info.GetDouble("Value");
				s.Variance = info.GetDouble("Variance");
				s.Vary = info.GetBoolean("Vary");

				return s;
			}
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				var guid = System.Xml.XmlConvert.ToGuid(info.GetString("Guid"));

				var s = ImageFormats.FirstOrDefault(x => x.Guid == guid);

				if (null == s)
					s = new ImageFormat(guid);

				return s;
			}
Beispiel #14
0
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				int numberOfLevelsDown = info.GetInt32("LevelsDown");

				int count = info.OpenArray("Path");
				var arr = new string[count];
				for (int i = 0; i < count; i++)
					arr[i] = info.GetString();
				info.CloseArray(count);

				return new RelativeDocumentPath(numberOfLevelsDown, arr);
			}
Beispiel #15
0
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				string colorSetName = info.GetString("Name");
				var colorSetLevel = (Altaxo.Main.ItemDefinitionLevel)info.GetEnum("Level", typeof(Altaxo.Main.ItemDefinitionLevel));
				var creationDate = info.GetDateTime("CreationDate");
				var isPlotColorSet = info.GetBoolean("IsPlotColorSet");

				int count = info.OpenArray("Colors");
				var colors = new NamedColor[count];
				for (int i = 0; i < count; ++i)
				{
					string name = info.GetStringAttribute("Name");
					string cvalue = info.GetString("e");
					colors[i] = new NamedColor(AxoColor.FromInvariantString(cvalue), name);
				}

				info.CloseArray(count);

				return new ColorSet(colorSetName, colors);
			}
Beispiel #16
0
		private ColorSet(Altaxo.Serialization.Xml.IXmlDeserializationInfo info)
		{
			_name = info.GetString("Name");

			int count = info.OpenArray("Colors");
			_innerList = new NamedColor[count];
			for (int i = 0; i < count; ++i)
			{
				string name = info.GetStringAttribute("Name");
				string cvalue = info.GetString("e");
				_innerList[i] = new NamedColor(AxoColor.FromInvariantString(cvalue), name, this);
			}
			info.CloseArray(count);

			InitLazyVariables();
		}
			protected virtual RealFourierTransformation2DOptions SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				var s = (o == null ? new RealFourierTransformation2DOptions() : (RealFourierTransformation2DOptions)o);

				s._isUserDefinedRowIncrementValue = info.GetBoolean("IsUserDefinedRowIncrementValue");
				s._rowIncrementValue = info.GetDouble("RowIncrementValue");
				s._isUserDefinedColumnIncrementValue = info.GetBoolean("IsUserDefinedColumnIncrementValue");
				s._columnIncrementValue = info.GetDouble("ColumnIncrementValue");
				s._replacementValueForNaNMatrixElements = info.GetNullableDouble("ReplacementValueForNaNMatrixElements");
				s._replacementValueForInfiniteMatrixElements = info.GetNullableDouble("ReplacementValueForInfiniteMatrixElements");
				s._dataPretreatmentCorrectionOrder = info.GetNullableInt32("DataPretreatmentCorrectionOrder");
				s._fourierWindow = (Altaxo.Calc.Fourier.Windows.IWindows2D)info.GetValue("FourierWindow", s);

				s._kindOfOutputResult = (RealFourierTransformationOutputKind)info.GetEnum("KindOfOutputResult", typeof(RealFourierTransformationOutputKind));
				s._centerResult = info.GetBoolean("CenterResult");
				s._resultFractionOfRows = info.GetDouble("ResultFractionOfRows");
				s._resultFractionOfColumns = info.GetDouble("ResultFractionOfColumns");

				s._outputFrequencyHeaderColumns = info.GetBoolean("OutputFrequencyHeaderColumns");
				s._frequencyRowHeaderColumnName = info.GetString("FrequencyRowHeaderColumnName");
				s._frequencyColumnHeaderColumnName = info.GetString("FrequencyColumnHeaderColumnName");

				s._outputPeriodHeaderColumns = info.GetBoolean("OutputPeriodHeaderColumns");
				s._periodRowHeaderColumnName = info.GetString("PeriodRowHeaderColumnName");
				s._periodColumnHeaderColumnName = info.GetString("PeriodColumnHeaderColumnName");

				return s;
			}
Beispiel #18
0
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				var s = null != o ? (TextGraphic)o : new TextGraphic(info);

				info.GetBaseValueEmbedded(s, typeof(TextGraphic).BaseType, parent);

				s._text = info.GetString("Text");
				s._font = (FontX)info.GetValue("Font", s);
				s._textBrush = (BrushX)info.GetValue("Brush", s);
				s._textBrush.ParentObject = s;

				s.Background = (IBackgroundStyle)info.GetValue("BackgroundStyle", s);

				s._lineSpacingFactor = info.GetSingle("LineSpacing");
				return s;
			}
Beispiel #19
0
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				TextGraphic s = null != o ? (TextGraphic)o : new TextGraphic(info);
				info.GetBaseValueEmbedded(s, "AltaxoBase,Altaxo.Graph.GraphicsObject,0", parent);

				// we have changed the meaning of rotation in the meantime, This is not handled in GetBaseValueEmbedded,
				// since the former versions did not store the version number of embedded bases
				//s._rotation = -s._rotation;

				s._text = info.GetString("Text");
				s._font = (FontX)info.GetValue("Font", s);
				s._textBrush = (BrushX)info.GetValue("Brush", s);
				if (null != s._textBrush) s._textBrush.ParentObject = s;
				s.BackgroundStyleOld = (BackgroundStyle)info.GetValue("BackgroundStyle", s);
				s._lineSpacingFactor = info.GetSingle("LineSpacing");
				info.GetSingle("ShadowLength");
				var xAnchorType = (XAnchorPositionType)info.GetValue("XAnchor", s);
				var yAnchorType = (YAnchorPositionType)info.GetValue("YAnchor", s);
				s._location.LocalAnchorX = RADouble.NewRel(0.5 * (int)xAnchorType);
				s._location.LocalAnchorY = RADouble.NewRel(0.5 * (int)yAnchorType);

				return s;
			}
Beispiel #20
0
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				DataColumnScript s = null != o ? (DataColumnScript)o : new DataColumnScript();

				ScriptStyle scriptStyle = (ScriptStyle)info.GetInt32("Style");
				string scriptText = info.GetString("Text");
				string rowFrom = info.GetString("From");
				string rowCondition = info.GetString("Cond");
				string rowTo = info.GetString("To");
				string rowInc = info.GetString("Inc");

				s.ScriptText = scriptText;

				return s;
			}
Beispiel #21
0
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				TextGraphic s = null != o ? (TextGraphic)o : new TextGraphic(info);
				if (info.CurrentElementName == "BaseType") // that was included since 2006-06-20
				{
					info.GetBaseValueEmbedded(s, typeof(TextGraphic).BaseType, parent);
				}
				else
				{
					info.GetBaseValueEmbedded(s, "AltaxoBase,Altaxo.Graph.GraphicsObject,0", parent); // before 2006-06-20, it was version 0 of the GraphicsObject
				}

				s._text = info.GetString("Text");
				s._font = (FontX)info.GetValue("Font", s);
				s._textBrush = (BrushX)info.GetValue("Brush", s);
				if (null != s._textBrush) s._textBrush.ParentObject = s;
				s._background = (IBackgroundStyle)info.GetValue("BackgroundStyle", s);
				if (null != s._background) s._background.ParentObject = s;
				s._lineSpacingFactor = info.GetSingle("LineSpacing");
				var xAnchorType = (XAnchorPositionType)info.GetValue("XAnchor", s);
				var yAnchorType = (YAnchorPositionType)info.GetValue("YAnchor", s);
				s._location.LocalAnchorX = RADouble.NewRel(0.5 * (int)xAnchorType);
				s._location.LocalAnchorY = RADouble.NewRel(0.5 * (int)yAnchorType);
				return s;
			}
 public override void Deserialize(GraphDocument s, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
 {
   base.Deserialize(s, info, parent);
   s._graphIdentifier = info.GetString("GraphIdentifier");
   s._notes = info.GetString("Notes");
   s._creationTime = info.GetDateTime("CreationTime").ToUniversalTime();
   s._lastChangeTime = info.GetDateTime("LastChangeTime").ToUniversalTime();
 }
Beispiel #23
0
      public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
      {
        
        TextGraphic s = null!=o ? (TextGraphic)o : new TextGraphic(); 
        info.GetBaseValueEmbedded(s,typeof(TextGraphic).BaseType,parent);

        // we have changed the meaning of rotation in the meantime, This is not handled in GetBaseValueEmbedded, 
        // since the former versions did not store the version number of embedded bases
        s._rotation = -s._rotation;

        s._text = info.GetString("Text");
        s._font = (Font)info.GetValue("Font",typeof(Font));
        s._textBrush = (BrushX)info.GetValue("Brush",typeof(BrushX));
        s.BackgroundStyleOld = (BackgroundStyle)info.GetValue("BackgroundStyle",typeof(BackgroundStyle));
        s._lineSpacingFactor = info.GetSingle("LineSpacing");
        info.GetSingle("ShadowLength");
        s._xAnchorType = (XAnchorPositionType)info.GetValue("XAnchor",typeof(XAnchorPositionType));
        s._yAnchorType = (YAnchorPositionType)info.GetValue("YAnchor",typeof(YAnchorPositionType));

        return s;
      }
      public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
      {
        
        GraphDocument s = null!=o ? (GraphDocument)o : new GraphDocument();

        //  info.GetBaseValueEmbedded(s,typeof(GraphDocument).BaseType,parent);
        s._name            =  info.GetString("Name"); 
        s._pageBounds      = (RectangleF)info.GetValue("PageBounds",s);
        s._printableBounds = (RectangleF)info.GetValue("PrintableBounds",s);

        s._layers          = (XYPlotLayerCollection)info.GetValue("LayerList",s);
        s._layers.ParentObject = s;


        return s;
      }
      public virtual void Deserialize(GraphDocument s, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
      {
        //  info.GetBaseValueEmbedded(s,typeof(GraphDocument).BaseType,parent);
        s._name            =  info.GetString("Name"); 
        s._pageBounds      = (RectangleF)info.GetValue("PageBounds",s);
        s._printableBounds = (RectangleF)info.GetValue("PrintableBounds",s);

        s._layers          = (XYPlotLayerCollection)info.GetValue("LayerList",s);
        s._layers.ParentObject = s;
        s._layers.SetPrintableGraphBounds(s._printableBounds, false);

        // new in version 1 - Add graph properties
        int numberproperties = info.OpenArray(); // "GraphProperties"
        for(int i=0;i<numberproperties;i++)
        {
          info.OpenElement(); // "e"
          string propkey = info.GetString("Key");
          object propval = info.GetValue("Value",parent);
          info.CloseElement(); // "e"
          s.SetGraphProperty(propkey,propval);
        }
        info.CloseArray(numberproperties);
      }
Beispiel #26
0
      public virtual MemoryStreamImageProxy SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
      {

        MemoryStreamImageProxy s = null != o ? (MemoryStreamImageProxy)o : new MemoryStreamImageProxy();
        s._url = info.GetString("Url");
        s._name = info.GetString("Name");
        s._hash = info.GetString("Hash");
        s._stream = info.GetMemoryStream("Stream");

        return s;
      }
Beispiel #27
0
 public virtual ResourceImageProxy SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
 {
   ResourceImageProxy s = null != o ? (ResourceImageProxy)o : new ResourceImageProxy();
   s._url = info.GetString("Url");
   s._name = info.GetString("Name");
   return s;
 }
Beispiel #28
0
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				ColumnStyle s = (ColumnStyle)o;
				s._columnSize = (int)info.GetSingle("Size");

				object notneeded;
				notneeded = info.GetValue("Pen", s);
				notneeded = info.GetValue("TextBrush", s);

				notneeded = info.GetValue("SelTextBrush", s);
				notneeded = info.GetValue("BkgBrush", s);

				notneeded = info.GetValue("SelBkgBrush", s);
				s._textFormat.Alignment = (StringAlignment)Enum.Parse(typeof(StringAlignment), info.GetString("Alignment"));
				s._textFont = (FontX)info.GetValue("Font", s);

				s.ParentObject = (Main.IDocumentNode)parent;
				return s;
			}
Beispiel #29
0
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				ColumnStyle s = (ColumnStyle)o;

				if ("Size" == info.CurrentElementName)
					return new XmlSerializationSurrogate0().Deserialize(o, info, parent);

				s._columnStyleType = (ColumnStyleType)info.GetEnum("Type", typeof(ColumnStyleType));
				s._columnSize = (int)info.GetSingle("Size");
				s._textFormat.Alignment = (StringAlignment)Enum.Parse(typeof(StringAlignment), info.GetString("Alignment"));
				s._isCellPenCustom = info.GetBoolean("CustomPen");
				if (s._isCellPenCustom)
				{
					s.CellBorder = (PenX)info.GetValue("Pen", s);
				}
				else
				{
					s.SetDefaultCellBorder();
				}

				s._isTextBrushCustom = info.GetBoolean("CustomText");
				if (s._isTextBrushCustom)
				{
					s.TextBrush = (BrushX)info.GetValue("TextBrush", s);
				}
				else
				{
					s.SetDefaultTextBrush();
				}

				s._isBackgroundBrushCustom = info.GetBoolean("CustomBkg");
				if (s._isBackgroundBrushCustom)
				{
					s.BackgroundBrush = (BrushX)info.GetValue("BkgBrush", s);
				}
				else
				{
					s.SetDefaultBackgroundBrush();
				}

				bool isCustomFont = info.GetBoolean("CustomFont");
				if (isCustomFont)
					s.TextFont = (FontX)info.GetValue("Font", s);
				else
					s.SetDefaultTextFont();

				s.ParentObject = (Main.IDocumentNode)parent;
				return s;
			}
Beispiel #30
0
      public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
      {

        TextGraphic s = null != o ? (TextGraphic)o : new TextGraphic();
        info.GetBaseValueEmbedded(s, typeof(TextGraphic).BaseType, parent);

        s._text = info.GetString("Text");
        s._font = (Font)info.GetValue("Font", typeof(Font));
        s._textBrush = (BrushX)info.GetValue("Brush", typeof(BrushX));
        s._background = (IBackgroundStyle)info.GetValue("BackgroundStyle", typeof(IBackgroundStyle));
        s._lineSpacingFactor = info.GetSingle("LineSpacing");
        s._xAnchorType = (XAnchorPositionType)info.GetValue("XAnchor", typeof(XAnchorPositionType));
        s._yAnchorType = (YAnchorPositionType)info.GetValue("YAnchor", typeof(YAnchorPositionType));

        return s;
      }