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

C#

 
GeneralRe: change interface type to other interface type Pin
Richard Deeming10-Apr-14 6:11
mveRichard Deeming10-Apr-14 6:11 
GeneralRe: change interface type to other interface type Pin
Nico Haegens11-Apr-14 6:07
professionalNico Haegens11-Apr-14 6:07 
AnswerRe: change interface type to other interface type Pin
Keith Barrow10-Apr-14 5:12
professionalKeith Barrow10-Apr-14 5:12 
GeneralRe: change interface type to other interface type Pin
Nico Haegens10-Apr-14 6:26
professionalNico Haegens10-Apr-14 6:26 
GeneralRe: change interface type to other interface type Pin
Keith Barrow10-Apr-14 22:28
professionalKeith Barrow10-Apr-14 22:28 
GeneralRe: change interface type to other interface type Pin
Nico Haegens11-Apr-14 0:31
professionalNico Haegens11-Apr-14 0:31 
GeneralRe: change interface type to other interface type Pin
Keith Barrow11-Apr-14 0:38
professionalKeith Barrow11-Apr-14 0:38 
QuestionSerialize subclass of windows.forms.label Pin
DanielSheets10-Apr-14 3:08
DanielSheets10-Apr-14 3:08 
I have a subclass of Windows.Forms.Label that I'd like to serialize to XML without using IXmlSerializable. A windows control (a Label in this case) isn't serializable.

Consider the following...

C#
public class SubLabel : Windows.Forms.Label
{
   public Text {get; set;}
   public int LocationX {get; set;}
   public int LocationY {get; set;}

   public void Save(string path)
   {
       XmlSerializer xs = new XmlSerializer(typeof(SubLabel));
       using (StreamWriter sw = new StreamWriter(path))
       {
           xs.Serialize(sw, this);
       }
   }

   public static SubLabel Load(string path)
   {
       XmlSerializer xs = new XmlSerializer(typeof(TestClass));
       using (StreamReader sr = new StreamReader(path))
       {
           return (SubLabel)xs.Deserialize(sr);
       }
   }
   ...
}


All I want to serialize are the public properties above.
I'd like to keep it simple by using the Save() and Load() methods above.

Of course this fails because of the Label parent class.

Is there an easy way to do this?
AnswerRe: Serialize subclass of windows.forms.label Pin
Ravi Bhavnani10-Apr-14 3:54
professionalRavi Bhavnani10-Apr-14 3:54 
QuestionDownload From Autoconfig Help Pin
LawlessBaron10-Apr-14 1:03
LawlessBaron10-Apr-14 1:03 
QuestionRe: Download From Autoconfig Help Pin
Eddy Vluggen10-Apr-14 3:02
professionalEddy Vluggen10-Apr-14 3:02 
AnswerRe: Download From Autoconfig Help Pin
LawlessBaron10-Apr-14 16:49
LawlessBaron10-Apr-14 16:49 
GeneralRe: Download From Autoconfig Help Pin
Eddy Vluggen11-Apr-14 7:40
professionalEddy Vluggen11-Apr-14 7:40 
Questionstrange behaviour of click method Pin
joost.versteegen10-Apr-14 0:28
joost.versteegen10-Apr-14 0:28 
AnswerRe: strange behaviour of click method Pin
Rob Philpott10-Apr-14 0:50
Rob Philpott10-Apr-14 0:50 
GeneralRe: strange behaviour of click method Pin
joost.versteegen10-Apr-14 1:13
joost.versteegen10-Apr-14 1:13 
GeneralRe: strange behaviour of click method Pin
Rob Philpott10-Apr-14 1:44
Rob Philpott10-Apr-14 1:44 
GeneralRe: strange behaviour of click method Pin
joost.versteegen10-Apr-14 1:47
joost.versteegen10-Apr-14 1:47 
GeneralRe: strange behaviour of click method Pin
Rob Philpott10-Apr-14 1:53
Rob Philpott10-Apr-14 1:53 
GeneralRe: strange behaviour of click method Pin
joost.versteegen10-Apr-14 3:38
joost.versteegen10-Apr-14 3:38 
GeneralRe: strange behaviour of click method Pin
Dave Kreskowiak10-Apr-14 3:55
mveDave Kreskowiak10-Apr-14 3:55 
AnswerRe: strange behaviour of click method Pin
Richard MacCutchan10-Apr-14 2:31
mveRichard MacCutchan10-Apr-14 2:31 
GeneralRe: strange behaviour of click method Pin
joost.versteegen10-Apr-14 3:27
joost.versteegen10-Apr-14 3:27 
GeneralRe: strange behaviour of click method Pin
Richard MacCutchan10-Apr-14 3:39
mveRichard MacCutchan10-Apr-14 3:39 
AnswerRe: strange behaviour of click method Pin
Eddy Vluggen10-Apr-14 3:01
professionalEddy Vluggen10-Apr-14 3:01 

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.