Click here to Skip to main content
15,917,808 members
Home / Discussions / C#
   

C#

 
GeneralRe: Giant memory leaks or what? Pin
Libor Tinka27-Jul-05 9:00
Libor Tinka27-Jul-05 9:00 
GeneralRe: Giant memory leaks or what? Pin
Libor Tinka27-Jul-05 9:04
Libor Tinka27-Jul-05 9:04 
AnswerRe: Giant memory leaks or what? Pin
Judah Gabriel Himango27-Jul-05 9:11
sponsorJudah Gabriel Himango27-Jul-05 9:11 
GeneralRe: Giant memory leaks or what? Pin
Libor Tinka27-Jul-05 9:40
Libor Tinka27-Jul-05 9:40 
GeneralRe: Giant memory leaks or what? Pin
Judah Gabriel Himango27-Jul-05 9:46
sponsorJudah Gabriel Himango27-Jul-05 9:46 
GeneralRe: Giant memory leaks or what? Pin
Libor Tinka27-Jul-05 9:56
Libor Tinka27-Jul-05 9:56 
AnswerRe: Giant memory leaks or what? Pin
Andy Brummer27-Jul-05 11:46
sitebuilderAndy Brummer27-Jul-05 11:46 
GeneralEnumerations Pin
MarkMokris27-Jul-05 8:17
MarkMokris27-Jul-05 8:17 
This is a very fundamental question about the use of enumerations in C#. I want to write out the value of an enumeration like System.Drawing.FontStyle to a file like this:

Font f...<br />
StreamWriter sw...<br />
<br />
:<br />
<br />
sw.WriteLine(f.FontStyle);


But then I want to read it in without having to use an if statement to decode it. This is what I want to avoid doing:

String myFontStyleReadIn...<br />
<br />
if (myFontStyleReadIn == "Bold") f = new Font("Arial",8,FontStyle.Bold)<br />
else<br />
if (myFontStyleReadIn == "Italic") f = new Font("Arial",8,FontStyle.Italic)

...

How do I write out the value of the enumeration, then read in the value and instantiate a new font using it?

Thanks!

Mark
GeneralRe: Enumerations Pin
Libor Tinka27-Jul-05 8:23
Libor Tinka27-Jul-05 8:23 
GeneralRe: Enumerations Pin
Matt Gerrans27-Jul-05 8:24
Matt Gerrans27-Jul-05 8:24 
GeneralRe: Enumerations Pin
Matt Gerrans27-Jul-05 8:34
Matt Gerrans27-Jul-05 8:34 
GeneralRe: Enumerations Pin
MarkMokris27-Jul-05 8:29
MarkMokris27-Jul-05 8:29 
GeneralRe: Enumerations Pin
Libor Tinka27-Jul-05 8:40
Libor Tinka27-Jul-05 8:40 
GeneralStatic Panel and the IDE Pin
Peter Vertes27-Jul-05 8:10
Peter Vertes27-Jul-05 8:10 
GeneralRe: Static Panel and the IDE Pin
Libor Tinka27-Jul-05 8:53
Libor Tinka27-Jul-05 8:53 
Generaldisabling windows keys Pin
Sam 200627-Jul-05 7:38
Sam 200627-Jul-05 7:38 
GeneralRe: disabling windows keys Pin
Peter Vertes27-Jul-05 8:15
Peter Vertes27-Jul-05 8:15 
GeneralAsynchronous socket problems in windows service Pin
daniilzol27-Jul-05 7:04
daniilzol27-Jul-05 7:04 
GeneralRe: Asynchronous socket problems in windows service Pin
Roman Rodov27-Jul-05 19:15
Roman Rodov27-Jul-05 19:15 
GeneralRe: Asynchronous socket problems in windows service Pin
daniilzol28-Jul-05 6:01
daniilzol28-Jul-05 6:01 
GeneralRowFilter Pin
zaboboa27-Jul-05 6:14
zaboboa27-Jul-05 6:14 
GeneralRe: RowFilter Pin
pedrito6827-Jul-05 6:37
pedrito6827-Jul-05 6:37 
GeneralRe: RowFilter Pin
zaboboa27-Jul-05 7:45
zaboboa27-Jul-05 7:45 
GeneralRe: RowFilter Pin
boodi_8128-Jul-05 3:42
boodi_8128-Jul-05 3:42 
GeneralHttpWebRequest Pin
Neel0727-Jul-05 5:50
Neel0727-Jul-05 5:50 

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.