Example #1
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var s = (G2DPlotStyleCollection)o ?? new G2DPlotStyleCollection();

                int count = info.OpenArray();

                for (int i = 0; i < count; i++)
                {
                    var item = info.GetValue("e", null);
                    if (item is object[])
                    {
                        foreach (var itemInner in (object[])item)
                        {
                            s.Add((IG2DPlotStyle)itemInner, false);
                        }
                    }
                    else
                    {
                        s.Add((IG2DPlotStyle)item, false);
                    }
                }

                info.CloseArray(count);
                return(s);
            }
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                int count = info.OpenArray();

                IG2DPlotStyle[] array = new IG2DPlotStyle[count];
                for (int i = 0; i < count; i++)
                {
                    array[i] = (IG2DPlotStyle)info.GetValue("e", this);
                }
                info.CloseArray(count);

                if (o == null)
                {
                    return(new G2DPlotStyleCollection(array));
                }
                else
                {
                    G2DPlotStyleCollection s = (G2DPlotStyleCollection)o;
                    for (int i = count - 1; i >= 0; i--)
                    {
                        s.Add(array[i]);
                    }
                    return(s);
                }
            }
Example #3
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                XYZMeshedColumnPlotData s = null != o ? (XYZMeshedColumnPlotData)o : new XYZMeshedColumnPlotData();

                var _xColumn = (IReadableColumnProxy)info.GetValue("XColumn", s);
                var _yColumn = (IReadableColumnProxy)info.GetValue("YColumn", s);

                int count        = info.OpenArray();
                var _dataColumns = new IReadableColumnProxy[count];

                for (int i = 0; i < count; i++)
                {
                    _dataColumns[i] = (IReadableColumnProxy)info.GetValue("e", s);
                }
                info.CloseArray(count);

#pragma warning disable 618
                s._matrixProxy = new DataTableMatrixProxy(_xColumn, _yColumn, _dataColumns);
#pragma warning restore 618

                s._xBoundaries = (IPhysicalBoundaries)info.GetValue("XBoundaries", s);
                s._yBoundaries = (IPhysicalBoundaries)info.GetValue("YBoundaries", s);
                s._vBoundaries = (IPhysicalBoundaries)info.GetValue("VBoundaries", s);

                s._matrixProxy.ParentObject = s;
                s._xBoundaries.ParentObject = s;
                s._yBoundaries.ParentObject = s;
                s._vBoundaries.ParentObject = s;

                s._isCachedDataValid = false;

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

                s.InternalSetDataTable((DataTableProxy)info.GetValue("Table", s));
                s._groupNumber = info.GetInt32("Group");

                s._useAllAvailableDataRows = info.GetBoolean("UseAllAvailableDataRows");

                int countBundles = info.OpenArray("DataColumnsBundles");

                for (int b = 0; b < countBundles; b++)
                {
                    info.OpenElement();
                    string identifier             = info.GetString("Identifier");
                    int?   MaximumNumberOfColumns = info.GetNullableInt32("MaximumNumberOfColumns");

                    var columnBundleInfo = new ColumnBundleInfo(MaximumNumberOfColumns);

                    int countColumns = info.OpenArray();
                    for (int i = 0; i < countColumns; i++)
                    {
                        s.InternalAddDataColumnNoClone(columnBundleInfo, (IReadableColumnProxy)info.GetValue("e", s));
                    }
                    info.CloseArray(countColumns);

                    s._dataColumnBundles.Add(identifier, columnBundleInfo);

                    info.CloseElement();
                }
                info.CloseArray(countBundles);

                if (!s._useAllAvailableDataRows)
                {
                    s._participatingDataRows = (AscendingIntegerCollection)info.GetValue("DataRows", s);
                }
                else
                {
                    s._participatingDataRows = new AscendingIntegerCollection();
                }

                s._isDirty = true;

                s._parent = parent as Main.IDocumentNode;
                return(s);
            }
Example #5
0
            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);
            }
Example #6
0
            protected virtual XYPlotLayer SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                XYPlotLayer s = (o == null ? new XYPlotLayer(info) : (XYPlotLayer)o);
                int         count;

                // size, position, rotation and scale
                var location = (XYPlotLayerPositionAndSize_V0)info.GetValue("LocationAndSize", s);

                s._cachedLayerSize     = (SizeF)info.GetValue("CachedSize", s);
                s._cachedLayerPosition = (PointF)info.GetValue("CachedPosition", s);
                s.Location             = location.ConvertToCurrentLocationVersion(s._cachedLayerSize, s._cachedLayerPosition);

                // CoordinateSystem
                s.CoordinateSystem = (G2DCoordinateSystem)info.GetValue("CoordinateSystem", s);
                s.CoordinateSystem.UpdateAreaSize(s._cachedLayerSize);

                // linked layers
                count = info.OpenArray("LinkedLayers");
                var linkedLayer = (Main.RelDocNodeProxy)info.GetValue("e", s);

                info.CloseArray(count);

                // Scales
                var linkedScales = (Altaxo.Graph.Scales.Deprecated.LinkedScaleCollection)info.GetValue("Scales", s);

                s.SetupOldAxes(linkedScales);
                ProvideLinkedScalesWithLinkedLayerIndex(s, linkedLayer, info);

                // Grid planes
                s.GridPlanes = (GridPlaneCollection)info.GetValue("GridPlanes", s);

                // Axis Styles
                s.AxisStyles = (AxisStyleCollection)info.GetValue("AxisStyles", s);

                // Legends
                var legends = (IList <IGraphicBase>)info.GetValue("Legends", s);

                // Graphic objects
                s.GraphObjects.AddRange((IEnumerable <IGraphicBase>)info.GetValue("GraphObjects", s));

                foreach (var item in legends)
                {
                    if (item is TextGraphic)
                    {
                        var l = new LegendText((TextGraphic)item);
                        s.GraphObjects.Add(l);
                    }
                }

                // Data Clipping
                s.ClipDataToFrame = (LayerDataClipping)info.GetValue("DataClipping", s);

                // PlotItemCollection
                s.PlotItems = (PlotItemCollection)info.GetValue("Plots", s);

                return(s);
            }
Example #7
0
            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);
            }
Example #8
0
        private CSPlaneIDList(Altaxo.Serialization.Xml.IXmlDeserializationInfo info)
        {
            _innerList = new List <CSPlaneID>();
            int count = info.OpenArray("PlaneIDs");

            for (int i = count; i > 0; i--)
            {
                _innerList.Add((CSPlaneID)info.GetValue("e", null));
            }
            info.CloseArray(count);
        }
Example #9
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                int count = info.OpenArray();
                var arr   = new string[count];

                for (int i = 0; i < count; i++)
                {
                    arr[i] = info.GetString();
                }
                info.CloseArray(count);
                return(new AbsoluteDocumentPath(arr));
            }
Example #10
0
        protected StyleListBag(Altaxo.Serialization.Xml.IXmlDeserializationInfo info)
        {
            int count = info.OpenArray("StyleLists");
            var lists = new TList[count];

            for (int i = 0; i < count; ++i)
            {
                lists[i] = (TList)info.GetValue("e", null);
            }
            info.CloseArray(count);
            _styleLists = lists;
        }
Example #11
0
            protected override void Deserialize(WorksheetLayout s, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                base.Deserialize(s, info, parent);

                int count = info.OpenArray(); // DefaultPropertyColumnStyles

                for (int i = 0; i < count; i++)
                {
                    var defstyle = (ColumnStyle)info.GetValue("DefaultPropertyColumnStyle", s._propertyColumnStyles);
                    s._propertyColumnStyles.SetDefaultColumnStyle(defstyle.GetType(), defstyle);
                }
                info.CloseArray(count);
            }
Example #12
0
            protected virtual SuppressedTicks SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                SuppressedTicks s = null != o ? (SuppressedTicks)o : new SuppressedTicks();

                int count;

                count = info.OpenArray("ByValues");
                for (int i = 0; i < count; i++)
                {
                    s._suppressedTickValues.Add((AltaxoVariant)info.GetValue("e", s));
                }
                info.CloseArray(count);

                count = info.OpenArray("ByNumbers");
                for (int i = 0; i < count; i++)
                {
                    s._suppressedTicksByNumber.Add(info.GetInt32("e"));
                }
                info.CloseArray(count);

                return(s);
            }
Example #13
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var s     = (o == null ? new AsciiLineStructure() : (AsciiLineStructure)o);
                var count = info.OpenArray("ColumnTypes");

                for (int i = 0; i < count; ++i)
                {
                    s.ColumnTypes.Add((AsciiColumnType)info.GetEnum("e", typeof(AsciiColumnType)));
                }
                info.CloseArray(count);

                return(s);
            }
Example #14
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var isAbsolutePath = info.GetBoolean("IsAbsolute");

                if (isAbsolutePath)
                {
                    int count = info.OpenArray();
                    var arr   = new string[count];
                    for (int i = 0; i < count; i++)
                    {
                        arr[i] = info.GetString();
                    }
                    info.CloseArray(count);
                    return(new AbsoluteDocumentPath(arr));
                }
                else
                {
                    int numberBackwards = 0;
                    var list            = new List <string>();

                    int count = info.OpenArray();
                    for (int i = 0; i < count; i++)
                    {
                        var item = info.GetString();
                        if (item == "..")
                        {
                            numberBackwards++;
                        }
                        else
                        {
                            list.Add(item);
                        }
                    }
                    info.CloseArray(count);

                    return(new RelativeDocumentPath(numberBackwards, list));
                }
            }
Example #15
0
            protected virtual LinearPartitioning SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var s = (o == null ? new LinearPartitioning() : (LinearPartitioning)o);

                int count = info.OpenArray("Partitioning");

                for (int i = 0; i < count; ++i)
                {
                    s.Add((RADouble)info.GetValue("e", s));
                }
                info.CloseArray(count);

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

                int count = info.OpenArray("Items");

                for (int i = 0; i < count; i++)
                {
                    s._itemList.Add(info.GetString("e"));
                }
                info.CloseArray(count);

                return(s);
            }
Example #17
0
            public virtual object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                ParameterSet s = o != null ? (ParameterSet)o : new ParameterSet();

                int arraycount = info.OpenArray();

                for (int i = 0; i < arraycount; ++i)
                {
                    s.Add((ParameterSetElement)info.GetValue("e", s));
                }
                info.CloseArray(arraycount);

                return(s);
            }
        public object Deserialize(object obj, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
        {
            int count = info.OpenArray("List");
            var s     = null != obj ? (System.Collections.Generic.List <object>)obj : new System.Collections.Generic.List <object>(count);

            s.Clear();
            for (int i = 0; i < count; ++i)
            {
                s.Add(info.GetValue("e", parent));
            }
            info.CloseArray(count);

            return(s);
        }
Example #19
0
        public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
        {
            int count = info.OpenArray("PrefixList");

            var list = new SIPrefix[count];

            for (int i = 0; i < count; ++i)
            {
                list[i] = (SIPrefix)info.GetValue("e", parent);
            }
            info.CloseArray(count);

            return(new SIPrefixList(list));
        }
            protected virtual AxisStyleCollection SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                AxisStyleCollection s = null != o ? (AxisStyleCollection)o : new AxisStyleCollection();

                int count = info.OpenArray();

                for (int i = 0; i < count; ++i)
                {
                    s._axisStyles.Add((AxisStyle)info.GetValue("e", s));
                }
                info.CloseArray(count);

                return(s);
            }
Example #21
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                double offset = info.GetDouble("DashOffset");
                int    count  = info.OpenArray("Pattern");

                double[] pattern = new double[count];
                for (int i = 0; i < pattern.Length; ++i)
                {
                    pattern[i] = info.GetDouble("e");
                }
                info.CloseArray(count);

                return(DeserializeV0(new Custom(offset, pattern), info, parent));
            }
Example #22
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var s = o as List <FileName> ?? new List <FileName>();

                s.Clear();
                int count = info.OpenArray("Properties");

                for (int i = 0; i < count; ++i)
                {
                    s.Add(FileName.Create(info.GetString("e")));
                }
                info.CloseArray(count);
                return(s);
            }
Example #23
0
            protected virtual CSPlaneIDList SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                CSPlaneIDList s = (o == null ? new CSPlaneIDList() : (CSPlaneIDList)o);

                int count = info.OpenArray("PlaneIDs");

                for (int i = count; i > 0; i--)
                {
                    s.Add((CSPlaneID)info.GetValue("e", s));
                }
                info.CloseArray(count);

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

                int count;

                count = info.OpenArray("ByValues");
                for (int i = 0; i < count; i++)
                {
                    s._additionalTicks.Add((AltaxoVariant)info.GetValue("e", s));
                }
                info.CloseArray(count);

                return(s);
            }
Example #25
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                IList <IGraphicBase> s = null != o ? (IList <IGraphicBase>)o : new List <IGraphicBase>();

                int count = info.OpenArray();

                for (int i = 0; i < count; i++)
                {
                    var go = (IGraphicBase)info.GetValue("e", s);
                    s.Add(go);
                }
                info.CloseArray(count);

                return(s);
            }
Example #26
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                int count = info.OpenArray("Transformations");
                var arr   = new List <IVariantToVariantTransformation>(count);

                for (int i = 0; i < count; ++i)
                {
                    arr.Add((IVariantToVariantTransformation)info.GetValue("e", null));
                }
                info.CloseArray(count);
                return(new CompoundTransformation()
                {
                    _transformations = arr
                });
            }
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                int count = info.OpenArray("RowSelections");

                var list = new List <IRowSelection>();

                for (int i = 0; i < count; ++i)
                {
                    list.Add((IRowSelection)info.GetValue("e", parent));
                }

                info.CloseArray(count);

                return(new IntersectionOfRowSelections(info, list));
            }
Example #28
0
            protected virtual GridPlaneCollection SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                GridPlaneCollection s = (o == null ? new GridPlaneCollection() : (GridPlaneCollection)o);

                int count = info.OpenArray("GridPlanes");

                for (int i = 0; i < count; i++)
                {
                    var plane = (GridPlane)info.GetValue("e", s);
                    s.Add(plane);
                }
                info.CloseArray(count);

                return(s);
            }
Example #29
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var s = (UserDefinedUnitEnvironments)o ?? new UserDefinedUnitEnvironments(info);

                var count = info.OpenArray("Environments");

                for (int i = 0; i < count; ++i)
                {
                    var env = (UserDefinedUnitEnvironment)info.GetValue("e", null);
                    s.Add(env.Name, env);
                }
                info.CloseArray(count);

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

                int count = info.OpenArray("Properties");

                s._linkedScales = new LinkedScale[count];
                for (int i = 0; i < count; ++i)
                {
                    s.SetLinkedScale((LinkedScale)info.GetValue("e", s), i);
                }
                info.CloseArray(count);

                return(s);
            }