FarPoint.Web.Spread.Appearance appr = new FarPoint.Web.Spread.Appearance();
FarPoint.Web.Spread.Cell acell;
appr.BackColor = Color.Red;
appr.ForeColor = Color.White;
appr.Font.Bold = true;
appr.HorizontalAlign = HorizontalAlign.Right;
appr.VerticalAlign = VerticalAlign.Top;
acell = FpSpread1.Cells[0,0];
acell.BackColor = appr.BackColor;
acell.ForeColor = appr.ForeColor;
acell.Font.Bold = appr.Font.Bold;
acell.HorizontalAlign = appr.HorizontalAlign;
acell.VerticalAlign = appr.VerticalAlign;
FpSpread1.ActiveSheetView.SetValue(0, 0, "Appearance Test");
FpSpread1.Columns[0].Width = 150;
FpSpread1.Rows[0].Height = 60;
private void Button1_Click(object sender, System.EventArgs e)
{
string fileName = "D:\\Temp\\myser.xml";
System.IO.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("Appearance");
appr.Serialize(writer);
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Close();
}
private void Button2_Click(object sender, System.EventArgs e)
{
bool b;
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
System.Xml.XmlNode node;
System.Xml.XmlNodeReader r;
doc.Load("D:\\Temp\\myser.xml");
node = doc.FirstChild;
while (!node.Name.Equals("Appearance"))
node = node.NextSibling;
r = new System.Xml.XmlNodeReader(node);
r.Read();
b = appr.Deserialize(r);
ListBox1.Items.Add(b.ToString());
}