Click here to Skip to main content
16,005,038 members
Home / Discussions / C#
   

C#

 
AnswerRe: Hanlde Event when C# exe is aborted abruptly Pin
Dave Kreskowiak18-Jul-07 5:48
mveDave Kreskowiak18-Jul-07 5:48 
AnswerRe: Hanlde Event when C# exe is aborted abruptly Pin
Paul Conrad18-Jul-07 5:56
professionalPaul Conrad18-Jul-07 5:56 
GeneralRe: Hanlde Event when C# exe is aborted abruptly Pin
harvid18-Jul-07 20:49
harvid18-Jul-07 20:49 
QuestionQuick question involving xml deserialization and strings Pin
ruanr18-Jul-07 4:22
ruanr18-Jul-07 4:22 
AnswerRe: Quick question involving xml deserialization and strings Pin
originSH18-Jul-07 4:30
originSH18-Jul-07 4:30 
AnswerRe: Quick question involving xml deserialization and strings Pin
Jon Hulatt18-Jul-07 4:34
Jon Hulatt18-Jul-07 4:34 
GeneralRe: Quick question involving xml deserialization and strings Pin
originSH18-Jul-07 4:52
originSH18-Jul-07 4:52 
AnswerRe: Quick question involving xml deserialization and strings Pin
Pete O'Hanlon18-Jul-07 4:35
mvePete O'Hanlon18-Jul-07 4:35 
Off the top of my head, you could try this:
public T FromString<T>(string serializedObject) where T : new()
{
  XmlSerializer xmlSer = new XmlSerializer(typeof(T));
  StringReader sr = new StringReader(serializedObject);
  XmlTextReader stream = new XmlTextReader(sr);

  try
  {
    T obj = (T)xmlSer.Deserialize(stream);
    return obj;
  }
  catch(Exception ex)
  {
    // Log ex...
  }
  finally
  {
    sr.Close();
    stream.Close();
  }
}




Please visit http://www.readytogiveup.com/ and do something special today.
Deja View - the feeling that you've seen this post before.

GeneralRe: Quick question involving xml deserialization and strings Pin
ruanr18-Jul-07 4:39
ruanr18-Jul-07 4:39 
GeneralRe: Quick question involving xml deserialization and strings Pin
Pete O'Hanlon18-Jul-07 4:46
mvePete O'Hanlon18-Jul-07 4:46 
QuestionMaking a simple button Pin
sharpiesharpie18-Jul-07 4:13
sharpiesharpie18-Jul-07 4:13 
AnswerRe: Making a simple button Pin
Jon Hulatt18-Jul-07 4:37
Jon Hulatt18-Jul-07 4:37 
AnswerRe: Making a simple button Pin
Jimmanuel18-Jul-07 7:04
Jimmanuel18-Jul-07 7:04 
QuestionCustom Validators - Basics Pin
imnotso#18-Jul-07 4:10
imnotso#18-Jul-07 4:10 
AnswerRe: Custom Validators - Basics Pin
Pete O'Hanlon18-Jul-07 5:20
mvePete O'Hanlon18-Jul-07 5:20 
QuestionSorry I neither know how to do any Pin
jagafa18-Jul-07 4:06
jagafa18-Jul-07 4:06 
AnswerRe: Sorry I neither know how to do any Pin
Pete O'Hanlon18-Jul-07 4:11
mvePete O'Hanlon18-Jul-07 4:11 
QuestionError reading MSMQ Pin
ramdil18-Jul-07 3:33
ramdil18-Jul-07 3:33 
AnswerRe: Error reading MSMQ Pin
Pete O'Hanlon18-Jul-07 4:12
mvePete O'Hanlon18-Jul-07 4:12 
GeneralRe: Error reading MSMQ Pin
ramdil18-Jul-07 5:42
ramdil18-Jul-07 5:42 
QuestionGridview : how to get an "Excel Freeze panes"-like behavior ? Pin
SierraMike18-Jul-07 2:32
SierraMike18-Jul-07 2:32 
AnswerRe: Gridview : how to get an "Excel Freeze panes"-like behavior ? Pin
Tarakeshwar Reddy18-Jul-07 2:53
professionalTarakeshwar Reddy18-Jul-07 2:53 
QuestionGetting input from command window? Pin
liqnit18-Jul-07 2:30
liqnit18-Jul-07 2:30 
AnswerRe: Getting input from command window? Pin
originSH18-Jul-07 2:46
originSH18-Jul-07 2:46 
GeneralRe: Getting input from command window? Pin
liqnit18-Jul-07 3:23
liqnit18-Jul-07 3:23 

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.