Click here to Skip to main content
15,920,896 members
Home / Discussions / C#
   

C#

 
QuestionInserting a row into excel spreadsheet Pin
lourensG10-Sep-07 23:25
lourensG10-Sep-07 23:25 
AnswerRe: Inserting a row into excel spreadsheet Pin
pmarfleet10-Sep-07 23:27
pmarfleet10-Sep-07 23:27 
GeneralRe: Inserting a row into excel spreadsheet Pin
lourensG10-Sep-07 23:43
lourensG10-Sep-07 23:43 
GeneralRe: Inserting a row into excel spreadsheet Pin
pmarfleet11-Sep-07 0:50
pmarfleet11-Sep-07 0:50 
GeneralRe: Inserting a row into excel spreadsheet Pin
Jimmanuel11-Sep-07 4:59
Jimmanuel11-Sep-07 4:59 
QuestionHow to cancel selection char in RichText control ? Pin
Yanshof10-Sep-07 23:17
Yanshof10-Sep-07 23:17 
AnswerRe: How to cancel selection char in RichText control ? Pin
Giorgi Dalakishvili10-Sep-07 23:33
mentorGiorgi Dalakishvili10-Sep-07 23:33 
AnswerRe: How to cancel selection char in RichText control ? Pin
Ermak8610-Sep-07 23:38
Ermak8610-Sep-07 23:38 
GeneralRe: How to cancel selection char in RichText control ? Pin
Yanshof11-Sep-07 18:08
Yanshof11-Sep-07 18:08 
GeneralRe: How to cancel selection char in RichText control ? Pin
Ermak8611-Sep-07 22:22
Ermak8611-Sep-07 22:22 
QuestionFreeze user access Pin
Glen Harvy10-Sep-07 22:52
Glen Harvy10-Sep-07 22:52 
AnswerRe: Freeze user access Pin
Giorgi Dalakishvili10-Sep-07 23:03
mentorGiorgi Dalakishvili10-Sep-07 23:03 
GeneralRe: Freeze user access Pin
Glen Harvy11-Sep-07 0:07
Glen Harvy11-Sep-07 0:07 
GeneralRe: Freeze user access Pin
Luc Pattyn11-Sep-07 0:44
sitebuilderLuc Pattyn11-Sep-07 0:44 
GeneralRe: Freeze user access Pin
Glen Harvy11-Sep-07 1:52
Glen Harvy11-Sep-07 1:52 
GeneralRe: Freeze user access Pin
Luc Pattyn11-Sep-07 2:15
sitebuilderLuc Pattyn11-Sep-07 2:15 
QuestionProblems with treeview in WPF Pin
sinosoidal10-Sep-07 22:29
sinosoidal10-Sep-07 22:29 
GeneralRe: Problems with treeview in WPF Pin
asit4u114-Dec-09 3:54
asit4u114-Dec-09 3:54 
QuestionHow to serialize a class that has both of two worlds Pin
sinosoidal10-Sep-07 22:27
sinosoidal10-Sep-07 22:27 
hi,


I want to serialize a class which has the two kinds of elements. Custom elements (non graphic and made by me, which are serializable by the XmlSerializer), and UI Elements from the WPF. The class which i want to serialize is this:



Code Snippet

public class Region : ISerializable

{

private Control _control;

public Control Control

{

get { return _control; }

set { _control = value; }

}

private Border _bounds;

public Border Bounds

{

get { return _bounds; }

set { _bounds = value; }

}

public Region()

{

}

///

/// Initializes a new instance of the class.

///

public Region(Border bounds)

{

_bounds = bounds;

}

public Region(SerializationInfo info, StreamingContext ctxt)

{

this._control = (Control)info.GetValue("Control", typeof(Control));

this._bounds = (Border)XamlReader.Load(new XmlTextReader(new StringReader((string)info.GetValue("Bounds", typeof(string)))));

}

public void GetObjectData(SerializationInfo info, StreamingContext ctxt)

{

info.AddValue("Control", this._control);

info.AddValue("Bounds", XamlWriter.Save(_bounds));

}

}







As you can see, this class is composed by a Control (custom made class specified by me) and a Border (UI Element). The class was serializable if i didnt have the border on it.



My attempt was to override the Iserialize methods in order to have serialization of the border based on XamlWriter.Save but it gives me error before getting there, in the following line:



Code Snippet

System.Xml.Serialization.XmlSerializer writer = new System.Xml.Serialization.XmlSerializer(typeof(Region));





With the message:



Code Snippet
"There was an error reflecting property 'Bounds'."





How can i solve this problem?



Thx,



Nuno
QuestionDifficult question Pin
andredani10-Sep-07 22:06
andredani10-Sep-07 22:06 
AnswerRe: Difficult question Pin
pmarfleet10-Sep-07 23:25
pmarfleet10-Sep-07 23:25 
QuestionUnicode problem Pin
Muammar©10-Sep-07 22:00
Muammar©10-Sep-07 22:00 
AnswerRe: Unicode problem Pin
Martin#10-Sep-07 22:19
Martin#10-Sep-07 22:19 
GeneralRe: Unicode problem Pin
Muammar©11-Sep-07 19:35
Muammar©11-Sep-07 19:35 
Question20 Questions Algorithm Pin
Andre Trollip10-Sep-07 21:43
Andre Trollip10-Sep-07 21:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.