Пример #1
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;
			}
Пример #2
0
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				int count = info.OpenArray("ColorSets");
				var colorSets = new Tuple<IColorSet, bool>[count];
				for (int i = 0; i < count; ++i)
				{
					info.OpenElement(); // e
					colorSets[i] = new Tuple<IColorSet, bool>((IColorSet)info.GetValue("ColorSet", null), info.GetBoolean("IsPlotColorSet"));
					info.CloseElement();
				}

				info.CloseArray(count);

				return new ColorSetBag(colorSets);
			}
Пример #3
0
			public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
			{
				AscendingIntegerCollection s = null != o ? (AscendingIntegerCollection)o : new AscendingIntegerCollection();

				int count = info.OpenArray();

				for (int i = 0; i < count; i++)
				{
					info.OpenElement();
					int rangestart = info.GetInt32("Start");
					int rangecount = info.GetInt32("Count");
					info.CloseElement();
					s.AddRange(rangestart, rangecount);
				}
				info.CloseArray(count);
				return s;
			}
Пример #4
0
      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);
      }
Пример #5
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);
      }
Пример #6
0
      public virtual void Deserialize(DataTable s, Altaxo.Serialization.Xml.IXmlDeserializationInfo  info, object parent)
      {
        s._tableName = info.GetString("Name");
        s._dataColumns = (DataColumnCollection)info.GetValue("DataCols",s);
        s._dataColumns.ParentObject = s;
        s._propertyColumns = (DataColumnCollection)info.GetValue("PropCols",s);
        s._propertyColumns.ParentObject = s;

        // new in version 1
        s._tableScript = (TableScript)info.GetValue("TableScript",s);

        // new in version 2 - Add table properties
        int numberproperties = info.OpenArray(); // "TableProperties"
        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.SetTableProperty(propkey,propval);
        }
        info.CloseArray(numberproperties);
      }
Пример #7
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;
			}
      public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
      {
        Altaxo.Data.DataColumnCollection s = null!=o ? (Altaxo.Data.DataColumnCollection)o : new Altaxo.Data.DataColumnCollection();

        // deserialize the columns
        int count = info.OpenArray();
        for(int i=0;i<count;i++)
        {
          info.OpenElement(); // Column

          string name = info.GetString("Name");
          ColumnKind  kind = (ColumnKind)info.GetInt32("Kind");
          int    group = info.GetInt32("Group");
          object col = info.GetValue(s);
          if(col!=null)
            s.Add((DataColumn)col,new DataColumnInfo(name,kind,group));

          info.CloseElement(); // Column
        }
        info.CloseArray(count);

        // deserialize the scripts
        count = info.OpenArray();
        for(int i=0;i<count;i++)
        {
          info.OpenElement();
          string name =   info.GetString();
          IColumnScriptText script = (IColumnScriptText)info.GetValue(s);
          info.CloseElement();
          s.ColumnScripts.Add(s[name],script);
        }
        info.CloseArray(count); // end script array
        return s;
      }