Click here to Skip to main content
15,915,324 members
Home / Discussions / C#
   

C#

 
QuestionRegarding creation of table structure in word from C#.net. Pin
Ron.S27-Nov-07 18:52
Ron.S27-Nov-07 18:52 
AnswerRe: Regarding creation of table structure in word from C#.net. Pin
Paul Conrad27-Nov-07 18:55
professionalPaul Conrad27-Nov-07 18:55 
GeneralRe: Regarding creation of table structure in word from C#.net. Pin
Ron.S27-Nov-07 18:59
Ron.S27-Nov-07 18:59 
QuestionEncrypting Problem Pin
kingletas27-Nov-07 17:43
kingletas27-Nov-07 17:43 
AnswerRe: Encrypting Problem Pin
Paul Conrad28-Nov-07 14:37
professionalPaul Conrad28-Nov-07 14:37 
QuestionHow to refresh child picturebox when moving (with mouse) on parent picturebox. Pin
Chintan.Desai27-Nov-07 17:39
Chintan.Desai27-Nov-07 17:39 
AnswerRe: Problem with "A low-level audio player in C#" Pin
Christian Graus27-Nov-07 19:14
protectorChristian Graus27-Nov-07 19:14 
QuestionTextbox and Integer Pin
MasterSharp27-Nov-07 15:34
MasterSharp27-Nov-07 15:34 
AnswerRe: Textbox and Integer Pin
Luc Pattyn27-Nov-07 15:50
sitebuilderLuc Pattyn27-Nov-07 15:50 
GeneralRe: Textbox and Integer Pin
MasterSharp27-Nov-07 15:54
MasterSharp27-Nov-07 15:54 
QuestionMemory Resource for a reader [modified] Pin
Vanidor27-Nov-07 14:42
Vanidor27-Nov-07 14:42 
AnswerRe: Memory Resource for a reader Pin
TJoe29-Nov-07 2:23
TJoe29-Nov-07 2:23 
QuestionSurrounding cities functionality Pin
cliffr195427-Nov-07 13:45
professionalcliffr195427-Nov-07 13:45 
AnswerRe: Surrounding cities functionality Pin
Colin Angus Mackay27-Nov-07 14:08
Colin Angus Mackay27-Nov-07 14:08 
QuestionProgram Complete Pin
MasterSharp27-Nov-07 13:18
MasterSharp27-Nov-07 13:18 
AnswerRe: Program Complete Pin
Christian Graus27-Nov-07 19:15
protectorChristian Graus27-Nov-07 19:15 
QuestionC# Factory Pattern Pin
Jeffrey Walton27-Nov-07 12:47
Jeffrey Walton27-Nov-07 12:47 
AnswerRe: C# Factory Pattern Pin
martin_hughes27-Nov-07 13:43
martin_hughes27-Nov-07 13:43 
GeneralRe: C# Factory Pattern Pin
Jeffrey Walton27-Nov-07 14:50
Jeffrey Walton27-Nov-07 14:50 
Hi Martin,

Thanks. It's been too long since I had a Design Patterns class (and I cannot find the text book from college).

In the examples, it seems Main() must know 'a priori' what classes to instaniate. Is this knowledge included in the Factory, or is this a poor example?

Perhaps if I briefly explain my problem domain, it will help cut to the chase.

Jeff

I parse a flat text file. Each token will become a distinct object. So I would like to:

Token t = NextToken()               // Base Class
Object o = Factory.CreateObject(t)  // Static method
o will then be Type1, Type2, Type3, etc. Factory::CreateObject would be a message cracker:
if( t.field = 1 ) { return new Type1(t); }
...
if( t.field = n ) { return new TypeN(t); }

GeneralRe: C# Factory Pattern Pin
martin_hughes28-Nov-07 3:19
martin_hughes28-Nov-07 3:19 
QuestionSimple question about ending loops Pin
falles0127-Nov-07 12:25
falles0127-Nov-07 12:25 
AnswerRe: Simple question about ending loops Pin
martin_hughes27-Nov-07 12:39
martin_hughes27-Nov-07 12:39 
GeneralRe: Simple question about ending loops Pin
falles0127-Nov-07 12:44
falles0127-Nov-07 12:44 
GeneralRe: Simple question about ending loops Pin
Colin Angus Mackay27-Nov-07 14:14
Colin Angus Mackay27-Nov-07 14:14 
GeneralRe: Simple question about ending loops Pin
martin_hughes27-Nov-07 14:52
martin_hughes27-Nov-07 14:52 

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.