Spread Windows Forms 10.0 Product Documentation
Deserialize Method (ExcelSparkline)
Example 


XmlNodeReader from which to read the object
Loads the object from XML.
Syntax
'Declaration
 
Public Overrides Function Deserialize( _
   ByVal r As XmlNodeReader _
) As Boolean
'Usage
 
Dim instance As ExcelSparkline
Dim r As XmlNodeReader
Dim value As Boolean
 
value = instance.Deserialize(r)
public override bool Deserialize( 
   XmlNodeReader r
)

Parameters

r
XmlNodeReader from which to read the object

Return Value

true if successful; otherwise, false
Example
This example uses the Deserialize method.
FarPoint.Win.Spread.ExcelSparkline es = new FarPoint.Win.Spread.ExcelSparkline(0, 5, this.fpSpread1.Sheets[0], new FarPoint.Win.Spread.Model.CellRange(0, 0, 1, 5));
string fileName = "c:\\ExcelSparkline.xml";
//Serialize
System.IO.Stream stream;
stream = System.IO.File.Open(fileName, System.IO.FileMode.Create);
System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(stream, System.Text.Encoding.UTF8);
writer.Formatting = System.Xml.Formatting.Indented; writer.Indentation = 2;
writer.WriteStartDocument();
writer.WriteStartElement("ExcelSparkline");           
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Close();

//Deserialize
FarPoint.Win.Spread.ExcelSparkline es1 = new FarPoint.Win.Spread.ExcelSparkline();
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(fileName);
System.Xml.XmlNode node;
node = doc.FirstChild;
while (!node.Name.Equals("ExcelSparkline"))
    node = node.NextSibling;
System.Xml.XmlNodeReader r = new System.Xml.XmlNodeReader(node);
r.Read();
Dim es As New FarPoint.Win.Spread.ExcelSparkline(0, 5, fpSpread1.Sheets(0), New FarPoint.Win.Spread.Model.CellRange(0, 0, 1, 5))
Dim fileName As String = "c:\ExcelSparkline.xml"
'Serialize
Dim stream As System.IO.Stream
stream = System.IO.File.Open(fileName, System.IO.FileMode.Create)
Dim writer As New System.Xml.XmlTextWriter(stream, System.Text.Encoding.UTF8)
writer.Formatting = System.Xml.Formatting.Indented
writer.Indentation = 2
writer.WriteStartDocument()
writer.WriteStartElement("ExcelSparkline")
writer.WriteEndElement()
writer.WriteEndDocument()
writer.Close()

'Deserialize
Dim es1 As New FarPoint.Win.Spread.ExcelSparkline()
Dim doc As New System.Xml.XmlDocument()
doc.Load(fileName)
Dim node As System.Xml.XmlNode
node = doc.FirstChild
While Not node.Name.Equals("ExcelSparkline")
    node = node.NextSibling
End While
Dim r As New System.Xml.XmlNodeReader(node)
r.Read()
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

ExcelSparkline Class
ExcelSparkline Members

 

 


Copyright © GrapeCity, inc. All rights reserved.