本文整理汇总了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));
}
示例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();
}
示例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());
}
示例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();
}