Click here to Skip to main content
15,899,026 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to retrieve the initial window state? Pin
Heath Stewart11-Nov-03 8:53
protectorHeath Stewart11-Nov-03 8:53 
GeneralComputer name Pin
Chathura10-Nov-03 12:10
Chathura10-Nov-03 12:10 
GeneralRe: Computer name Pin
Heath Stewart11-Nov-03 3:43
protectorHeath Stewart11-Nov-03 3:43 
GeneralActive Directory Adding Pin
Chathura10-Nov-03 11:53
Chathura10-Nov-03 11:53 
Questiona way to use arrays with negative pointers? Pin
Demokritos10-Nov-03 11:26
Demokritos10-Nov-03 11:26 
AnswerRe: a way to use arrays with negative pointers? Pin
Wjousts10-Nov-03 11:39
Wjousts10-Nov-03 11:39 
GeneralRe: a way to use arrays with negative pointers? Pin
Demokritos11-Nov-03 12:40
Demokritos11-Nov-03 12:40 
GeneralConvert string to class (sort of) Pin
MrEyes10-Nov-03 6:30
MrEyes10-Nov-03 6:30 
Convert a STRING!!!! to a CLASS!!! I hear you scream. Pull up a pew and let me explain the problem I have.

I am creating an application that pulls various values from an XML file and then uses these values to create various pieces of text within a PDF document. Now using iTextSharp (http://itextsharp.sourceforge.net/index.html[^]) this is fairly easy.

The problem is that I want/need everything to be driven by XML parameters, as an example to set the font of a particular piece of text you would use the following code :

basefont = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED)


CreateFont takes 3 parameters, and I want to be able to specify these parameters in the XML.

When the data comes out of the XML file it is in string format. So the desired effect can easily (ish) be achived, by using a massive multiple if/switch statement.

The problem is that using if's everything is hardcoded, so if I decided to use an uncoded font I would have to recompile and re-release code, which is a pain.

What I would like to do is set the follow parameters in XML :

<basefont_string>BaseFont.HELVETICA</basefont_string>
<basefont_encoding>BaseFont.CP1252</basefont_encoding>
<basefont_embedding>BaseFont.NOT_EMBEDDED</basefont_embedding>


Then use these as class values, rather than have to mess around with if's and switch's, so if I pulled the values using their XML tag names I would have the following line of code

basefont = BaseFont.createFont(basefont_string, basefont_encoding, basefont_embedding)


Did that make sense?

post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
GeneralRe: Convert string to class (sort of) Pin
Wjousts10-Nov-03 7:06
Wjousts10-Nov-03 7:06 
GeneralRe: Convert string to class (sort of) Pin
MrEyes10-Nov-03 7:09
MrEyes10-Nov-03 7:09 
GeneralRe: Convert string to class (sort of) Pin
Heath Stewart10-Nov-03 7:44
protectorHeath Stewart10-Nov-03 7:44 
GeneralA couple of line drawing questions... Pin
DoofToo10-Nov-03 6:12
DoofToo10-Nov-03 6:12 
GeneralRe: A couple of line drawing questions... Pin
mhmoud rawas11-Nov-03 1:36
mhmoud rawas11-Nov-03 1:36 
GeneralPrinting.. Pin
Amirjalaly10-Nov-03 5:50
Amirjalaly10-Nov-03 5:50 
GeneralRe: Printing.. Pin
Heath Stewart10-Nov-03 6:01
protectorHeath Stewart10-Nov-03 6:01 
GeneralRemoting and Events Pin
CillyMe10-Nov-03 5:08
CillyMe10-Nov-03 5:08 
GeneralRe: Remoting and Events Pin
Heath Stewart10-Nov-03 5:39
protectorHeath Stewart10-Nov-03 5:39 
GeneralRe: Remoting and Events Pin
CillyMe10-Nov-03 5:44
CillyMe10-Nov-03 5:44 
GeneralRe: Remoting and Events Pin
Heath Stewart10-Nov-03 5:51
protectorHeath Stewart10-Nov-03 5:51 
GeneralRe: Remoting and Events Pin
CillyMe10-Nov-03 14:37
CillyMe10-Nov-03 14:37 
GeneralRe: Remoting and Events Pin
Heath Stewart11-Nov-03 2:55
protectorHeath Stewart11-Nov-03 2:55 
GeneralRe: Remoting and Events Pin
LongRange.Shooter10-Nov-03 6:04
LongRange.Shooter10-Nov-03 6:04 
GeneralEnumerating Data Sources in C# Pin
Inam10-Nov-03 4:41
Inam10-Nov-03 4:41 
GeneralRe: Enumerating Data Sources in C# Pin
Heath Stewart10-Nov-03 5:33
protectorHeath Stewart10-Nov-03 5:33 
GeneralAlternatives to databinding Pin
Wjousts10-Nov-03 4:19
Wjousts10-Nov-03 4:19 

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.