Example #1
0
            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);
                }
            }
Example #2
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                XYFunctionPlotData     pa   = (XYFunctionPlotData)info.GetValue("Data", typeof(XYColumnPlotData));
                XYLineScatterPlotStyle lsps = (XYLineScatterPlotStyle)info.GetValue("Style", typeof(XYLineScatterPlotStyle));

                G2DPlotStyleCollection ps = new G2DPlotStyleCollection();

                ps.Add(new ScatterPlotStyle(lsps.ScatterStyle));
                ps.Add(new LinePlotStyle(lsps.XYPlotLineStyle));

                if (null == o)
                {
                    return(new XYFunctionPlotItem(pa, ps));
                }
                else
                {
                    XYFunctionPlotItem s = (XYFunctionPlotItem)o;
                    s.Data  = pa;
                    s.Style = ps;
                    return(s);
                }
            }