Click here to Skip to main content
15,891,855 members
Home / Discussions / C#
   

C#

 
AnswerRe: Start Process With Dock Style Pin
Dave Kreskowiak14-Sep-14 11:04
mveDave Kreskowiak14-Sep-14 11:04 
QuestionDrawing Text on a Bitmap Pin
Richard Andrew x6414-Sep-14 10:01
professionalRichard Andrew x6414-Sep-14 10:01 
AnswerRe: Drawing Text on a Bitmap Pin
Ravi Bhavnani14-Sep-14 10:14
professionalRavi Bhavnani14-Sep-14 10:14 
GeneralRe: Drawing Text on a Bitmap Pin
Richard Andrew x6414-Sep-14 10:24
professionalRichard Andrew x6414-Sep-14 10:24 
GeneralRe: Drawing Text on a Bitmap Pin
Ravi Bhavnani14-Sep-14 10:38
professionalRavi Bhavnani14-Sep-14 10:38 
QuestionRemove Item in datagridcombocell when its already use on another row C# Pin
hussainroyal14-Sep-14 7:40
hussainroyal14-Sep-14 7:40 
QuestionCommand line export rtf to html in emmbeded Pin
Reninvaldo SIlva13-Sep-14 9:07
Reninvaldo SIlva13-Sep-14 9:07 
AnswerRe: Command line export rtf to html in emmbeded Pin
Dave Kreskowiak13-Sep-14 11:21
mveDave Kreskowiak13-Sep-14 11:21 
GeneralRe: Command line export rtf to html in emmbeded Pin
Reninvaldo SIlva13-Sep-14 13:38
Reninvaldo SIlva13-Sep-14 13:38 
GeneralRe: Command line export rtf to html in emmbeded Pin
Dave Kreskowiak13-Sep-14 17:18
mveDave Kreskowiak13-Sep-14 17:18 
GeneralRe: Command line export rtf to html in emmbeded Pin
Reninvaldo SIlva15-Sep-14 7:58
Reninvaldo SIlva15-Sep-14 7:58 
QuestionJust for the fun of it... Pin
Rob Philpott12-Sep-14 20:54
Rob Philpott12-Sep-14 20:54 
AnswerRe: Just for the fun of it... Pin
OriginalGriff12-Sep-14 21:12
mveOriginalGriff12-Sep-14 21:12 
GeneralRe: Just for the fun of it... Pin
Rob Philpott12-Sep-14 21:23
Rob Philpott12-Sep-14 21:23 
GeneralRe: Just for the fun of it... Pin
OriginalGriff12-Sep-14 22:14
mveOriginalGriff12-Sep-14 22:14 
GeneralRe: Just for the fun of it... Pin
harold aptroot12-Sep-14 22:19
harold aptroot12-Sep-14 22:19 
GeneralRe: Just for the fun of it... Pin
Rob Philpott13-Sep-14 0:24
Rob Philpott13-Sep-14 0:24 
GeneralRe: Just for the fun of it... Pin
harold aptroot13-Sep-14 0:28
harold aptroot13-Sep-14 0:28 
GeneralRe: Just for the fun of it... Pin
Rob Philpott13-Sep-14 1:02
Rob Philpott13-Sep-14 1:02 
QuestionMail sending in c# Pin
vidhyankr11-Sep-14 19:51
professionalvidhyankr11-Sep-14 19:51 
SuggestionRe: Mail sending in c# Pin
Richard MacCutchan11-Sep-14 21:34
mveRichard MacCutchan11-Sep-14 21:34 
AnswerRe: Mail sending in c# Pin
challa naresh kumar reddy12-Sep-14 1:50
challa naresh kumar reddy12-Sep-14 1:50 
QuestionAny suggestions for "compiling" strings? Pin
SledgeHammer0111-Sep-14 14:32
SledgeHammer0111-Sep-14 14:32 
I have a mini macro language for my application. Something along the lines of:

"Blah -- [SomeTag:SomeParam=SomeValue] -- Blah. Blah, Blah : [SomeTag2:SomeParam2=SomeValue2]"

So, my current implementation parses the string every time my method gets called, does error checking every time, etc. I parse the string with Regex group matching and then do a String.Replace() on the string to replace the macros with the resolved macro strings.

I get called many times with the same format string, but different parameters.

It doesn't really make sense to parse and error check, etc. every time. That'll be a performance hit. Especially with Regex.

How do people typically "compile" the string for tasks like this?

My first idea was to parse and error check the string the first time and replace the macros with a compact fixed string. For example, in the case above, the first time I would compile to:

"Blah -- $A1 -- Blah. Blah, Blah : $B1"

Then I would know that command $A1 means do SomeTag in SomeParam=SomeValue mode. $A2 would mean do SomeTag in SomeParam=SomeValue2 mode. SomeTag2 would be $B1, etc.

This would save me the regex and error checking every time. I would still have to do String.Replace() of course...

The tag operations are not static constants BTW, they come from various places.

Any other ideas?
AnswerRe: Any suggestions for "compiling" strings? Pin
PIEBALDconsult11-Sep-14 15:36
mvePIEBALDconsult11-Sep-14 15:36 
GeneralRe: Any suggestions for "compiling" strings? Pin
SledgeHammer0111-Sep-14 16:02
SledgeHammer0111-Sep-14 16:02 

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.