Spread Windows Forms 9.0 Product Documentation
Deserialize Method (NamedStyle)
Example 


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

Parameters

r
XmlNodeReader from which to load the object

Return Value

Boolean: true if successful; false otherwise
Example
This example deserializes the NamedStyle object.
FarPoint.Win.Spread.NamedStyle ns = new FarPoint.Win.Spread.NamedStyle();
FarPoint.Win.Spread.StyleInfo si = new FarPoint.Win.Spread.StyleInfo();
si.BackColor = Color.LightBlue;
ns.CopyFrom(si);
fpSpread1.ActiveSheet.DefaultStyle = ns;
bool b;
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
System.Xml.XmlNode node; 
System.Xml.XmlNodeReader r;
doc.Load("..\\files\\mystyle.xml");
node = doc.FirstChild;
while (!node.Name.Equals("Style"))
    node = node.NextSibling;
r = new System.Xml.XmlNodeReader(node);
r.Read();
b = ns.Deserialize(r);
listBox1.Items.Add(b.ToString());
Dim ns As New FarPoint.Win.Spread.NamedStyle()
Dim si As New FarPoint.Win.Spread.StyleInfo()
si.BackColor = Color.LightBlue
ns.CopyFrom(si)
FpSpread1.ActiveSheet.DefaultStyle = ns
Dim b As Boolean
Dim doc As New System.Xml.XmlDocument()
Dim node As System.Xml.XmlNode
Dim r As System.Xml.XmlNodeReader
doc.Load("..\files\mystyle.xml")
node = doc.FirstChild
While Not (node.Name.Equals("Style"))
 node = node.NextSibling
End While
r = New System.Xml.XmlNodeReader(node)
r.Read()
b = ns.Deserialize(r)
ListBox1.Items.Add(b)
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

NamedStyle Class
NamedStyle Members

 

 


Copyright © GrapeCity, inc. All rights reserved.