当前位置: 首页>>代码示例>>C#>>正文


C# Altaxo.IsSerializable方法代码示例

本文整理汇总了C#中Altaxo.IsSerializable方法的典型用法代码示例。如果您正苦于以下问题:C# Altaxo.IsSerializable方法的具体用法?C# Altaxo.IsSerializable怎么用?C# Altaxo.IsSerializable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Altaxo的用法示例。


在下文中一共展示了Altaxo.IsSerializable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Serialize

      public void Serialize(object obj, Altaxo.Serialization.Xml.IXmlSerializationInfo info)
      {
        FitFunctionToScalarFunctionDDWrapper s = (FitFunctionToScalarFunctionDDWrapper)obj;
       
        info.AddValue("IndependentVariable",s._independentVariable);
        info.AddValue("DependentVariable",s._dependentVariable);
        info.AddArray("ParameterValues",s._parameter,s._parameter.Length);

        if(s._fitFunction==null || info.IsSerializable(s._fitFunction))
          info.AddValue("FitFunction",s._fitFunction);
        else
          info.AddValue("FitFunction",new Altaxo.Serialization.Xml.AssemblyAndTypeSurrogate(s._fitFunction));
      }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:13,代码来源:FitFunctionToScalarFunctionDDWrapper.cs

示例2: Serialize

      public virtual void Serialize(object obj, Altaxo.Serialization.Xml.IXmlSerializationInfo info)
      {
        GraphDocument s = (GraphDocument)obj;

        // info.AddBaseValueEmbedded(s,typeof(GraphDocument).BaseType);
        // now the data of our class
        info.AddValue("Name",s._name);
        info.AddValue("PageBounds",s._pageBounds);
        info.AddValue("PrintableBounds",s._printableBounds);
        info.AddValue("Layers",s._layers);

        // new in version 1 - Add graph properties
        int numberproperties = s._graphProperties==null ? 0 : s._graphProperties.Keys.Count;
        info.CreateArray("TableProperties",numberproperties);
        if(s._graphProperties!=null)
        {
          foreach(string propkey in s._graphProperties.Keys)
          {
            if(propkey.StartsWith("tmp/"))
              continue;
            info.CreateElement("e");
            info.AddValue("Key",propkey);
            object val = s._graphProperties[propkey];
            info.AddValue("Value",info.IsSerializable(val) ? val : null);
            info.CommitElement();
          }
        }
        info.CommitArray();


      }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:31,代码来源:GraphDocument.cs

示例3: SaveWindowStateToZippedFile

    /// <summary>
    /// Saves the state of the main window into a zipped file.
    /// </summary>
    /// <param name="zippedStream">The file stream of the zip file.</param>
    /// <param name="info">The serialization info used to serialize the state of the main window.</param>
    public void SaveWindowStateToZippedFile(ICompressedFileContainerStream zippedStream, Altaxo.Serialization.Xml.XmlStreamSerializationInfo info)
    {
      System.Text.StringBuilder errorText = new System.Text.StringBuilder();

      {
        // first, we save our own state 
        zippedStream.StartFile("Workbench/MainWindow.xml", 0);
        try
        {
          info.BeginWriting(zippedStream.Stream);
          info.AddValue("MainWindow", Current.Workbench);
          info.EndWriting();
        }
        catch (Exception exc)
        {
          errorText.Append(exc.ToString());
        }
      }

      // second, we save all workbench windows into the Workbench/Views 
      int i = 0;
      foreach (IViewContent ctrl in Current.Workbench.ViewContentCollection)
      {
        if (info.IsSerializable(ctrl))
        {
          i++;
          zippedStream.StartFile("Workbench/Views/View" + i.ToString() + ".xml", 0);
          try
          {
            info.BeginWriting(zippedStream.Stream);
            info.AddValue("WorkbenchViewContent", ctrl);
            info.EndWriting();
          }
          catch (Exception exc)
          {
            errorText.Append(exc.ToString());
          }
        }
      }

      if (errorText.Length != 0)
        throw new ApplicationException(errorText.ToString());
    }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:48,代码来源:ProjectService.cs

示例4: Serialize

      public virtual void Serialize(object obj, Altaxo.Serialization.Xml.IXmlSerializationInfo  info)
      {
        Altaxo.Data.DataTable s = (Altaxo.Data.DataTable)obj;
        info.AddValue("Name",s._tableName); // name of the Table
        info.AddValue("DataCols",s._dataColumns);
        info.AddValue("PropCols", s._propertyColumns); // the property columns of that table

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

        // new in version 2 - Add table properties
        int numberproperties = s._tableProperties==null ? 0 : s._tableProperties.Keys.Count;
        info.CreateArray("TableProperties",numberproperties);
        if(s._tableProperties!=null)
        {
          foreach(string propkey in s._tableProperties.Keys)
          {
            if(propkey.StartsWith("tmp/"))
              continue;
            info.CreateElement("e");
            info.AddValue("Key",propkey);
            object val = s._tableProperties[propkey];
            info.AddValue("Value",info.IsSerializable(val) ? val : null);
            info.CommitElement();
          }
        }
        info.CommitArray();

      }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:29,代码来源:DataTable.cs


注:本文中的Altaxo.IsSerializable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。