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; }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { XYColumnPlotData pa = (XYColumnPlotData)info.GetValue("Data", typeof(XYColumnPlotData)); XYLineScatterPlotStyle lsps = (XYLineScatterPlotStyle)info.GetValue("Style", typeof(XYLineScatterPlotStyle)); if (lsps.XYPlotLineStyle != null) { lsps.XYPlotLineStyle.LineSymbolGap = lsps.LineSymbolGap; // this has changed and is now hosted in the LineStyle itself } G2DPlotStyleCollection ps = new G2DPlotStyleCollection(new IG2DPlotStyle[] { lsps.XYPlotLineStyle, lsps.ScatterStyle, lsps.XYPlotLabelStyle }); if (lsps.XYPlotLabelStyle != null) { XmlSerializationSurrogate0 surr = new XmlSerializationSurrogate0(); surr._item = pa; surr._label = lsps.XYPlotLabelStyle; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.info_DeserializationFinished); } if (null == o) { return(new XYColumnPlotItem(pa, ps)); } else { XYColumnPlotItem s = (XYColumnPlotItem)o; s.Data = pa; s.Style = ps; return(s); } }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { var s = null != o ? (WorksheetViewLayout)o : new WorksheetViewLayout(); var surr = new XmlSerializationSurrogate0 { _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); }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { XYColumnPlotData pa = (XYColumnPlotData)info.GetValue("Data", null); XYLineScatterPlotStyle lsps = (XYLineScatterPlotStyle)info.GetValue("Style", null); if (lsps.XYPlotLineStyle != null) lsps.XYPlotLineStyle.UseSymbolGap = lsps.LineSymbolGap; // this has changed and is now hosted in the LineStyle itself G2DPlotStyleCollection ps = new G2DPlotStyleCollection(new IG2DPlotStyle[] { lsps.XYPlotLineStyle, lsps.ScatterStyle, lsps.XYPlotLabelStyle }); if (lsps.XYPlotLabelStyle != null) { XmlSerializationSurrogate0 surr = new XmlSerializationSurrogate0(); surr._item = pa; surr._label = lsps.XYPlotLabelStyle; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.info_DeserializationFinished); } if (null == o) { return new XYColumnPlotItem(pa, ps); } else { XYColumnPlotItem s = (XYColumnPlotItem)o; s.Data = pa; s.Style = ps; return s; } }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { var s = null != o ? (TextDocumentViewOptions)o : new TextDocumentViewOptions(info); var pathToDocument = (AbsoluteDocumentPath)info.GetValue("Document", s); s.WindowConfiguration = (ViewerConfiguration)info.GetEnum("WindowConfiguration", typeof(ViewerConfiguration)); s.IsViewerSelected = info.GetBoolean("IsViewerSelected"); s._fractionOfSourceEditorWindowVisible = info.GetDouble("FractionSourceEditor"); s.IsWordWrappingEnabled = info.GetNullableBoolean("IsWordWrappingEnabled"); s.IsLineNumberingEnabled = info.GetNullableBoolean("IsLineNumberingEnabled"); s.IsSpellCheckingEnabled = info.GetNullableBoolean("IsSpellCheckingEnabled"); s.IsFoldingEnabled = info.GetNullableBoolean("IsFoldingEnabled"); s.HighlightingStyle = info.GetString("HighlightingStyle"); if (info.CurrentElementName == "IsOutlineWindowVisible") { s.IsOutlineWindowVisible = info.GetNullableBoolean("IsOutlineWindowVisible"); s.OutlineWindowRelativeWidth = info.GetNullableDouble("OutlineWindowRelativeWidth"); } var surr = new XmlSerializationSurrogate0 { _deserializedInstance = s, _pathToDocument = pathToDocument, }; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished); return(s); }
public virtual object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { bool bNeedsCallback = false; XYColumnPlotData s = null != o ? (XYColumnPlotData)o : new XYColumnPlotData(); object xColumn = info.GetValue("XColumn", typeof(Altaxo.Data.IReadableColumn)); object yColumn = info.GetValue("YColumn", typeof(Altaxo.Data.IReadableColumn)); if (xColumn is Altaxo.Data.IReadableColumn) { s.XColumn = (Altaxo.Data.IReadableColumn)xColumn; } else if (xColumn is Main.DocumentPath) { bNeedsCallback = true; } if (yColumn is Altaxo.Data.IReadableColumn) { s.YColumn = (Altaxo.Data.IReadableColumn)yColumn; } else if (yColumn is Main.DocumentPath) { bNeedsCallback = true; } s._xBoundaries = (IPhysicalBoundaries)info.GetValue("XBoundaries", typeof(IPhysicalBoundaries)); if (null != s._xBoundaries) { s._xBoundaries.BoundaryChanged += new BoundaryChangedHandler(s.EhXBoundariesChanged); } s._yBoundaries = (IPhysicalBoundaries)info.GetValue("YBoundaries", typeof(IPhysicalBoundaries)); if (null != s._yBoundaries) { s._yBoundaries.BoundaryChanged += new BoundaryChangedHandler(s.EhYBoundariesChanged); } if (bNeedsCallback) { XmlSerializationSurrogate0 surr = new XmlSerializationSurrogate0(); surr._xColumn = xColumn as Main.DocumentPath; surr._yColumn = yColumn as Main.DocumentPath; surr._plotAssociation = s; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished); } return(s); }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { LabelPlotStyle s = (LabelPlotStyle)XmlSerializationSurrogate0.SDeserialize(o, info, parent, false); s._labelColumn = (Altaxo.Data.ReadableColumnProxy)info.GetValue("LabelColumn", parent); // restore the cached values s.SetCachedValues(); s.CreateEventChain(); return(s); }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { FitFunctionScript s = null != o ? (FitFunctionScript)o : new FitFunctionScript(); // deserialize the base class info.GetBaseValueEmbedded(s, typeof(AbstractScript), parent); XmlSerializationSurrogate0 surr = new XmlSerializationSurrogate0(); surr._deserializedObject = s; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.info_DeserializationFinished); return(s); }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { var s = (GraphViewOptions)o ?? new GraphViewOptions(info); var pathToGraph = (AbsoluteDocumentPath)info.GetValue("Graph", s); s._rootLayerMarkersVisibility = info.GetNullableEnum <RootLayerMarkersVisibility>("RootLayerMarkersVisibility"); var surr = new XmlSerializationSurrogate0() { _deserializedObject = s, _pathToGraphDocument = pathToGraph }; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished); return(s); }
protected virtual void Deserialize(ColumnStyleDictionary s, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { var surr = new XmlSerializationSurrogate0 { _unresolvedColumns = new Dictionary <Main.AbsoluteDocumentPath, ColumnStyle>(), _deserializedInstance = s }; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished); int count; count = info.OpenArray(); // DefaultColumnStyles for (int i = 0; i < count; i++) { info.OpenElement(); // "e" string typeName = info.GetString("Type"); //Type t = Type.ReflectionOnlyGetType(typeName, false, false); var t = Type.GetType(typeName, false, false); var style = (ColumnStyle)info.GetValue("Style", s); if (null != style) { style.ParentObject = s; } s._defaultColumnStyles[t] = style; info.CloseElement(); // "e" } info.CloseArray(count); // deserialize the columnstyles // this must be deserialized in a new instance of this surrogate, since we can not resolve it immediately count = info.OpenArray(); if (count > 0) { for (int i = 0; i < count; i++) { info.OpenElement(); // "e" var key = (Main.AbsoluteDocumentPath)info.GetValue("Column", s); var val = (ColumnStyle)info.GetValue("Style", s); surr._unresolvedColumns.Add(key, val); info.CloseElement(); } } info.CloseArray(count); }
protected virtual void Deserialize(WorksheetLayout s, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { XmlSerializationSurrogate0 surr = new XmlSerializationSurrogate0(); surr.m_ColStyles = new System.Collections.Hashtable(); surr.m_TableLayout = s; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished); s.m_Guid = System.Xml.XmlConvert.ToGuid(info.GetString("Guid")); surr.m_PathToTable = (Main.DocumentPath)info.GetValue("Table", s); s.m_RowHeaderStyle = (RowHeaderStyle)info.GetValue("RowHeaderStyle", s); s.m_ColumnHeaderStyle = (ColumnHeaderStyle)info.GetValue("ColumnHeaderStyle", s); s.m_PropertyColumnHeaderStyle = (ColumnHeaderStyle)info.GetValue("PropertyColumnHeaderStyle", s); int count; count = info.OpenArray(); // DefaultColumnStyles for (int i = 0; i < count; i++) { object defstyle = info.GetValue("DefaultColumnStyle", s); s.DefaultColumnStyles.Add(defstyle.GetType(), defstyle); } info.CloseArray(count); // deserialize the columnstyles // this must be deserialized in a new instance of this surrogate, since we can not resolve it immediately count = info.OpenArray(); if (count > 0) { for (int i = 0; i < count; i++) { info.OpenElement(); // "e" Main.DocumentPath key = (Main.DocumentPath)info.GetValue("Column", s); object val = info.GetValue("Style", s); surr.m_ColStyles.Add(key, val); info.CloseElement(); } } info.CloseArray(count); }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { var s = null != o ? (GraphViewLayout)o : new GraphViewLayout(); if (info.CurrentElementName == "BaseType") { info.GetString("BaseType"); } s._isAutoZoomActive = info.GetBoolean("AutoZoom"); s._zoomFactor = info.GetSingle("Zoom"); var surr = new XmlSerializationSurrogate0 { _GraphController = s, _PathToGraph = (AbsoluteDocumentPath)info.GetValue("Graph", s) }; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished); return(s); }
public static object SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent, bool nativeCall) { LabelPlotStyle s = null != o ? (LabelPlotStyle)o : new LabelPlotStyle(); s._font = (Font)info.GetValue("Font", s); s._independentColor = info.GetBoolean("IndependentColor"); s._brush = (BrushX)info.GetValue("Brush", s); s._xOffset = info.GetDouble("XOffset"); s._yOffset = info.GetDouble("YOffset"); s._rotation = info.GetDouble("Rotation"); s.HorizontalAlignment = (System.Drawing.StringAlignment)info.GetEnum("HorizontalAlignment", typeof(System.Drawing.StringAlignment)); s.VerticalAlignment = (System.Drawing.StringAlignment)info.GetEnum("VerticalAlignment", typeof(System.Drawing.StringAlignment)); bool attachToAxis = info.GetBoolean("AttachToAxis"); EdgeType attachedAxis = (EdgeType)info.GetValue("AttachedAxis", parent); s._backgroundStyle = (IBackgroundStyle)info.GetValue("Background", s); s._labelColumn = (Altaxo.Data.ReadableColumnProxy)info.GetValue("LabelColumn", parent); if (attachToAxis) { s._attachedPlane = XmlSerializationSurrogate0.GetDirection(attachedAxis); } else { s._attachedPlane = null; } if (nativeCall) { // restore the cached values s.SetCachedValues(); s.CreateEventChain(); } return(s); }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { WorksheetController s = null!=o ? (WorksheetController)o : new WorksheetController(null,true); XmlSerializationSurrogate0 surr = new XmlSerializationSurrogate0(); surr._TableController = s; surr._PathToLayout = (Main.DocumentPath)info.GetValue("Layout",s); info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished); return s; }
public virtual object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { bool bNeedsCallback = false; XYColumnPlotData s = null != o ? (XYColumnPlotData)o : new XYColumnPlotData(info); object xColumn = info.GetValue("XColumn", s); object yColumn = info.GetValue("YColumn", s); if (xColumn is Altaxo.Data.IReadableColumn) s.XColumn = (Altaxo.Data.IReadableColumn)xColumn; else if (xColumn is Main.AbsoluteDocumentPath) bNeedsCallback = true; if (yColumn is Altaxo.Data.IReadableColumn) s.YColumn = (Altaxo.Data.IReadableColumn)yColumn; else if (yColumn is Main.AbsoluteDocumentPath) bNeedsCallback = true; s._xBoundaries = (IPhysicalBoundaries)info.GetValue("XBoundaries", s); if (null != s._xBoundaries) s._xBoundaries.ParentObject = s; s._yBoundaries = (IPhysicalBoundaries)info.GetValue("YBoundaries", s); if (null != s._yBoundaries) s._yBoundaries.ParentObject = s; if (bNeedsCallback) { XmlSerializationSurrogate0 surr = new XmlSerializationSurrogate0(); surr._xColumn = xColumn as Main.AbsoluteDocumentPath; surr._yColumn = yColumn as Main.AbsoluteDocumentPath; surr._plotAssociation = s; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished); } return s; }
protected virtual XYPlotLayer SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { XYPlotLayer s = null != o ? (XYPlotLayer)o : new XYPlotLayer(); bool fillLayerArea = info.GetBoolean("FillLayerArea"); BrushX layerAreaFillBrush = (BrushX)info.GetValue("LayerAreaFillBrush", typeof(BrushX)); if (fillLayerArea) { if(!s.GridPlanes.Contains(CSPlaneID.Front)) s.GridPlanes.Add(new GridPlane(CSPlaneID.Front)); s.GridPlanes[CSPlaneID.Front].Background = layerAreaFillBrush; } // size, position, rotation and scale s._location.WidthType = (XYPlotLayerSizeType)info.GetValue("WidthType", typeof(XYPlotLayerSizeType)); s._location.HeightType = (XYPlotLayerSizeType)info.GetValue("HeightType", typeof(XYPlotLayerSizeType)); s._location.Width = info.GetDouble("Width"); s._location.Height = info.GetDouble("Height"); s._cachedLayerSize = (SizeF)info.GetValue("CachedSize", typeof(SizeF)); s._coordinateSystem.UpdateAreaSize(s._cachedLayerSize); s._location.XPositionType = (XYPlotLayerPositionType)info.GetValue("XPositionType", typeof(XYPlotLayerPositionType)); s._location.YPositionType = (XYPlotLayerPositionType)info.GetValue("YPositionType", typeof(XYPlotLayerPositionType)); s._location.XPosition = info.GetDouble("XPosition"); s._location.YPosition = info.GetDouble("YPosition"); s._cachedLayerPosition = (PointF)info.GetValue("CachedPosition", typeof(PointF)); s._location.Angle = info.GetSingle("Rotation"); s._location.Scale = info.GetSingle("Scale"); // axis related s._linkedScales.X.Scale = (Scale)info.GetValue("XAxis", typeof(Scale)); s._linkedScales.Y.Scale = (Scale)info.GetValue("YAxis", typeof(Scale)); s._linkedScales.X.IsLinked = info.GetBoolean("LinkXAxis"); s._linkedScales.Y.IsLinked = info.GetBoolean("LinkYAxis"); s._linkedScales.X.LinkOrgA = info.GetDouble("LinkXAxisOrgA"); s._linkedScales.X.LinkOrgB = info.GetDouble("LinkXAxisOrgB"); s._linkedScales.X.LinkEndA = info.GetDouble("LinkXAxisEndA"); s._linkedScales.X.LinkEndB = info.GetDouble("LinkXAxisEndB"); s._linkedScales.Y.LinkOrgA = info.GetDouble("LinkYAxisOrgA"); s._linkedScales.Y.LinkOrgB = info.GetDouble("LinkYAxisOrgB"); s._linkedScales.Y.LinkEndA = info.GetDouble("LinkYAxisEndA"); s._linkedScales.Y.LinkEndB = info.GetDouble("LinkYAxisEndB"); // Styles bool showLeft = info.GetBoolean("ShowLeftAxis"); bool showBottom = info.GetBoolean("ShowBottomAxis"); bool showRight = info.GetBoolean("ShowRightAxis"); bool showTop = info.GetBoolean("ShowTopAxis"); s._axisStyles.AxisStyleEnsured(CSLineID.Y0).AxisLineStyle = (AxisLineStyle)info.GetValue("LeftAxisStyle", typeof(AxisLineStyle)); s._axisStyles.AxisStyleEnsured(CSLineID.X0).AxisLineStyle = (AxisLineStyle)info.GetValue("BottomAxisStyle", typeof(AxisLineStyle)); s._axisStyles.AxisStyleEnsured(CSLineID.Y1).AxisLineStyle = (AxisLineStyle)info.GetValue("RightAxisStyle", typeof(AxisLineStyle)); s._axisStyles.AxisStyleEnsured(CSLineID.X1).AxisLineStyle = (AxisLineStyle)info.GetValue("TopAxisStyle", typeof(AxisLineStyle)); s._axisStyles[CSLineID.Y0].MajorLabelStyle = (AxisLabelStyleBase)info.GetValue("LeftLabelStyle", typeof(AxisLabelStyleBase)); s._axisStyles[CSLineID.X0].MajorLabelStyle = (AxisLabelStyleBase)info.GetValue("BottomLabelStyle", typeof(AxisLabelStyleBase)); s._axisStyles[CSLineID.Y1].MajorLabelStyle = (AxisLabelStyleBase)info.GetValue("RightLabelStyle", typeof(AxisLabelStyleBase)); s._axisStyles[CSLineID.X1].MajorLabelStyle = (AxisLabelStyleBase)info.GetValue("TopLabelStyle", typeof(AxisLabelStyleBase)); // Titles and legend s._axisStyles[CSLineID.Y0].Title = (TextGraphic)info.GetValue("LeftAxisTitle", typeof(TextGraphic)); s._axisStyles[CSLineID.X0].Title = (TextGraphic)info.GetValue("BottomAxisTitle", typeof(TextGraphic)); s._axisStyles[CSLineID.Y1].Title = (TextGraphic)info.GetValue("RightAxisTitle", typeof(TextGraphic)); s._axisStyles[CSLineID.X1].Title = (TextGraphic)info.GetValue("TopAxisTitle", typeof(TextGraphic)); if (!showLeft) s._axisStyles.Remove(CSLineID.Y0); if (!showRight) s._axisStyles.Remove(CSLineID.Y1); if (!showBottom) s._axisStyles.Remove(CSLineID.X0); if (!showTop) s._axisStyles.Remove(CSLineID.X1); s.Legend = (TextGraphic)info.GetValue("Legend", typeof(TextGraphic)); // XYPlotLayer specific Main.DocumentPath linkedLayer = (Main.DocumentPath)info.GetValue("LinkedLayer", typeof(XYPlotLayer)); if (linkedLayer != null) { XmlSerializationSurrogate0 surr = new XmlSerializationSurrogate0(); surr._Layer = s; surr._LinkedLayerPath = linkedLayer; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished); } s._graphObjects = (GraphicCollection)info.GetValue("GraphObjects", typeof(GraphicCollection)); s._plotItems = (PlotItemCollection)info.GetValue("Plots", typeof(PlotItemCollection)); return s; }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { bool bSurrogateUsed = false; XYZMeshedColumnPlotData s = null != o ? (XYZMeshedColumnPlotData)o : new XYZMeshedColumnPlotData(); XmlSerializationSurrogate0 surr = new XmlSerializationSurrogate0(); #pragma warning disable 618 s._matrixProxy = DataTableMatrixProxy.CreateEmptyInstance(); // this instance is replaced later in the deserialization callback function and is intended to avoid null reference errors #pragma warning restore 618 object deserobj; deserobj = info.GetValue("XColumn", s); if (deserobj is Main.AbsoluteDocumentPath) { surr._xColumnPath = (Main.AbsoluteDocumentPath)deserobj; bSurrogateUsed = true; } else { surr._xColumnProxy = ReadableColumnProxyBase.FromColumn((Altaxo.Data.INumericColumn)deserobj); } deserobj = info.GetValue("YColumn", s); if (deserobj is Main.AbsoluteDocumentPath) { surr._yColumnPath = (Main.AbsoluteDocumentPath)deserobj; bSurrogateUsed = true; } else { surr._yColumnProxy = ReadableColumnProxyBase.FromColumn((Altaxo.Data.INumericColumn)deserobj); } int count = info.OpenArray(); surr._vColumnPaths = new Main.AbsoluteDocumentPath[count]; surr._vColumnProxies = new IReadableColumnProxy[count]; for (int i = 0; i < count; i++) { deserobj = info.GetValue("e", s); if (deserobj is Main.AbsoluteDocumentPath) { surr._vColumnPaths[i] = (Main.AbsoluteDocumentPath)deserobj; bSurrogateUsed = true; } else { surr._vColumnProxies[i] = ReadableColumnProxyBase.FromColumn((Altaxo.Data.IReadableColumn)deserobj); } } info.CloseArray(count); s._xBoundaries = (IPhysicalBoundaries)info.GetValue("XBoundaries", s); s._yBoundaries = (IPhysicalBoundaries)info.GetValue("YBoundaries", s); s._vBoundaries = (IPhysicalBoundaries)info.GetValue("VBoundaries", s); s._xBoundaries.ParentObject = s; s._yBoundaries.ParentObject = s; s._vBoundaries.ParentObject = s; if (bSurrogateUsed) { surr._plotAssociation = s; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished); } return s; }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { FitFunctionScript s = null != o ? (FitFunctionScript)o : new FitFunctionScript(); // deserialize the base class info.GetBaseValueEmbedded(s, typeof(AbstractScript), parent); XmlSerializationSurrogate0 surr = new XmlSerializationSurrogate0(); surr._deserializedObject = s; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.info_DeserializationFinished); return s; }
protected virtual void Deserialize(WorksheetLayout s, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { XmlSerializationSurrogate0 surr = new XmlSerializationSurrogate0(); surr.m_ColStyles = new System.Collections.Hashtable(); surr.m_TableLayout = s; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished); s.m_Guid = System.Xml.XmlConvert.ToGuid(info.GetString("Guid")); surr.m_PathToTable = (Main.DocumentPath)info.GetValue("Table",s); s.m_RowHeaderStyle = (RowHeaderStyle)info.GetValue("RowHeaderStyle" , s); s.m_ColumnHeaderStyle = (ColumnHeaderStyle)info.GetValue("ColumnHeaderStyle",s); s.m_PropertyColumnHeaderStyle = (ColumnHeaderStyle)info.GetValue("PropertyColumnHeaderStyle",s); int count; count = info.OpenArray(); // DefaultColumnStyles for(int i=0;i<count;i++) { object defstyle = info.GetValue("DefaultColumnStyle",s); s.DefaultColumnStyles.Add(defstyle.GetType(), defstyle); } info.CloseArray(count); // deserialize the columnstyles // this must be deserialized in a new instance of this surrogate, since we can not resolve it immediately count = info.OpenArray(); if(count>0) { for(int i=0;i<count;i++) { info.OpenElement(); // "e" Main.DocumentPath key = (Main.DocumentPath)info.GetValue("Column",s); object val = info.GetValue("Style",s); surr.m_ColStyles.Add(key,val); info.CloseElement(); } } info.CloseArray(count); }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { bool bSurrogateUsed = false; XYZMeshedColumnPlotData s = null != o ? (XYZMeshedColumnPlotData)o : new XYZMeshedColumnPlotData(); var surr = new XmlSerializationSurrogate0(); #pragma warning disable 618 s._matrixProxy = DataTableMatrixProxy.CreateEmptyInstance(); // this instance is replaced later in the deserialization callback function and is intended to avoid null reference errors #pragma warning restore 618 object deserobj; deserobj = info.GetValue("XColumn", s); if (deserobj is Main.AbsoluteDocumentPath) { surr._xColumnPath = (Main.AbsoluteDocumentPath)deserobj; bSurrogateUsed = true; } else { surr._xColumnProxy = ReadableColumnProxyBase.FromColumn((Altaxo.Data.INumericColumn)deserobj); } deserobj = info.GetValue("YColumn", s); if (deserobj is Main.AbsoluteDocumentPath) { surr._yColumnPath = (Main.AbsoluteDocumentPath)deserobj; bSurrogateUsed = true; } else { surr._yColumnProxy = ReadableColumnProxyBase.FromColumn((Altaxo.Data.INumericColumn)deserobj); } int count = info.OpenArray(); surr._vColumnPaths = new Main.AbsoluteDocumentPath[count]; surr._vColumnProxies = new IReadableColumnProxy[count]; for (int i = 0; i < count; i++) { deserobj = info.GetValue("e", s); if (deserobj is Main.AbsoluteDocumentPath) { surr._vColumnPaths[i] = (Main.AbsoluteDocumentPath)deserobj; bSurrogateUsed = true; } else { surr._vColumnProxies[i] = ReadableColumnProxyBase.FromColumn((Altaxo.Data.IReadableColumn)deserobj); } } info.CloseArray(count); s._xBoundaries = (IPhysicalBoundaries)info.GetValue("XBoundaries", s); s._yBoundaries = (IPhysicalBoundaries)info.GetValue("YBoundaries", s); s._vBoundaries = (IPhysicalBoundaries)info.GetValue("VBoundaries", s); s._xBoundaries.ParentObject = s; s._yBoundaries.ParentObject = s; s._vBoundaries.ParentObject = s; if (bSurrogateUsed) { surr._plotAssociation = s; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished); } return(s); }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { LinePlotStyle s = null != o ? (LinePlotStyle)o : new LinePlotStyle(info); s._linePen = (PenX)info.GetValue("Pen", s); if (null != s._linePen) { s._linePen.ParentObject = s; } s.Connection = (ILineConnectionStyle)info.GetValue("Connection", s); s._useSymbolGap = info.GetBoolean("LineSymbolGap"); s._ignoreMissingDataPoints = info.GetBoolean("IgnoreMissingPoints"); bool fillArea = info.GetBoolean("FillArea"); var fillBrush = (BrushX)info.GetValue("FillBrush", s); var fillDir = (XYPlotLineStyles.FillDirection)info.GetValue("FillDirection", s); s._independentColor = info.GetBoolean("IndependentColor"); if (!fillArea) { return(s); } else { var drop = new DropAreaPlotStyle(s.Connection, s.IgnoreMissingDataPoints, false, XmlSerializationSurrogate0.GetFillDirection(fillDir), fillBrush, ColorLinkage.PreserveAlpha); return(new object[] { s, drop }); } }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { bool bSurrogateUsed = false; XYZMeshedColumnPlotData s = null != o ? (XYZMeshedColumnPlotData)o : new XYZMeshedColumnPlotData(); XmlSerializationSurrogate0 surr = new XmlSerializationSurrogate0(); object deserobj; deserobj = info.GetValue("XColumn", s); if (deserobj is Main.DocumentPath) { surr._xColumn = (Main.DocumentPath)deserobj; bSurrogateUsed = true; } else { s.m_XColumn = (Altaxo.Data.INumericColumn)deserobj; if (deserobj is Altaxo.Data.DataColumn) { ((Altaxo.Data.DataColumn)deserobj).Changed += new EventHandler(s.EhColumnDataChangedEventHandler); } } deserobj = info.GetValue("YColumn", s); if (deserobj is Main.DocumentPath) { surr._yColumn = (Main.DocumentPath)deserobj; bSurrogateUsed = true; } else { s.m_YColumn = (Altaxo.Data.INumericColumn)deserobj; if (deserobj is Altaxo.Data.DataColumn) { ((Altaxo.Data.DataColumn)deserobj).Changed += new EventHandler(s.EhColumnDataChangedEventHandler); } } int count = info.OpenArray(); surr._vColumns = new Main.DocumentPath[count]; s.m_DataColumns = new Altaxo.Data.IReadableColumn[count]; for (int i = 0; i < count; i++) { deserobj = info.GetValue("YColumn", s); if (deserobj is Main.DocumentPath) { surr._vColumns[i] = (Main.DocumentPath)deserobj; bSurrogateUsed = true; } else { s.m_DataColumns[i] = (Altaxo.Data.IReadableColumn)deserobj; if (deserobj is Altaxo.Data.DataColumn) { ((Altaxo.Data.DataColumn)deserobj).Changed += new EventHandler(s.EhColumnDataChangedEventHandler); } } } info.CloseArray(count); s.m_xBoundaries = (NumericalBoundaries)info.GetValue("XBoundaries", typeof(NumericalBoundaries)); s.m_yBoundaries = (NumericalBoundaries)info.GetValue("YBoundaries", typeof(NumericalBoundaries)); s.m_vBoundaries = (NumericalBoundaries)info.GetValue("VBoundaries", typeof(NumericalBoundaries)); s.m_xBoundaries.BoundaryChanged += new BoundaryChangedHandler(s.OnXBoundariesChangedEventHandler); s.m_yBoundaries.BoundaryChanged += new BoundaryChangedHandler(s.OnYBoundariesChangedEventHandler); s.m_vBoundaries.BoundaryChanged += new BoundaryChangedHandler(s.OnVBoundariesChangedEventHandler); if (bSurrogateUsed) { surr._plotAssociation = s; info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished); } return(s); }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { GraphController s = null!=o ? (GraphController)o : new GraphController(null,true); s.m_AutoZoom = info.GetBoolean("AutoZoom"); s.m_Zoom = info.GetSingle("Zoom"); s.m_Graph = null; XmlSerializationSurrogate0 surr = new XmlSerializationSurrogate0(); surr._GraphController = s; surr._PathToGraph = (Main.DocumentPath)info.GetValue("Graph",s); info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished); return s; }