Click here to Skip to main content
16,015,623 members
Home / Discussions / C#
   

C#

 
AnswerRe: Windows Service interaction with Sys Tray icon Pin
JD8612-Oct-12 5:41
JD8612-Oct-12 5:41 
AnswerRe: Windows Service interaction with Sys Tray icon Pin
Eddy Vluggen12-Oct-12 5:45
professionalEddy Vluggen12-Oct-12 5:45 
GeneralRe: Windows Service interaction with Sys Tray icon Pin
JD8612-Oct-12 5:48
JD8612-Oct-12 5:48 
GeneralRe: Windows Service interaction with Sys Tray icon Pin
Dave Kreskowiak12-Oct-12 6:08
mveDave Kreskowiak12-Oct-12 6:08 
GeneralRe: Windows Service interaction with Sys Tray icon Pin
Eddy Vluggen12-Oct-12 10:57
professionalEddy Vluggen12-Oct-12 10:57 
GeneralRe: Windows Service interaction with Sys Tray icon Pin
JD8612-Oct-12 11:11
JD8612-Oct-12 11:11 
AnswerRe: Windows Service interaction with Sys Tray icon Pin
Eddy Vluggen12-Oct-12 13:33
professionalEddy Vluggen12-Oct-12 13:33 
QuestionRenaming tool project/class structure Pin
Adam_Dev12-Oct-12 4:46
Adam_Dev12-Oct-12 4:46 
Hi
I'm struggling with how to structure this project in relation to base/generic/abstract classes.

Basically I was asked to write something quickly to rename some files (e.g. "File 00123 F Bloggs") to extract the number and rename the file as that, i.e. "123". Thinking this was a one off I created a simple exe. Then I was asked to do it a few more times for different files (e.g. "NewFile 045 F B") to "45". The function is the same except it checks what the filename starts with to make sure it is only renaming those files. So I thought I'd write a generic renaming tool and just take in a parameter for the start of the filename to check.

However, then I was asked to rename files to a different format (e.g. "Info 123 (24-08-2012)") to "INF-CD-20120824". So obviously for this the function is different.

I decided to call each renaming option, a Profile.

I thought I could create an abstract base class with the common functionality for Rename(...), but then override it in derived classes when a custom version was needed.

But I also just want to be able to call _profiles.CurrentProfile.Rename(...). But how can I do that when CurrentProfile might be of different derived types?

Am I approaching this right with an abstract base class or should I be taking a different approach?

Can provide rough source if needed.

Thanks

modified 12-Oct-12 11:00am.

AnswerRe: Renaming tool project/class structure Pin
Eddy Vluggen12-Oct-12 5:28
professionalEddy Vluggen12-Oct-12 5:28 
GeneralRe: Renaming tool project/class structure Pin
Adam_Dev14-Oct-12 22:13
Adam_Dev14-Oct-12 22:13 
GeneralRe: Renaming tool project/class structure Pin
Eddy Vluggen15-Oct-12 0:40
professionalEddy Vluggen15-Oct-12 0:40 
AnswerRe: Renaming tool project/class structure Pin
n.podbielski12-Oct-12 5:35
n.podbielski12-Oct-12 5:35 
QuestionHow to implement a resumable HTTP download? Pin
Jun Du12-Oct-12 3:48
Jun Du12-Oct-12 3:48 
AnswerRe: How to implement a resumable HTTP download? Pin
Eddy Vluggen12-Oct-12 5:07
professionalEddy Vluggen12-Oct-12 5:07 
QuestionHow to change color (combo,Text etc) when enable=false Pin
himmubhai12-Oct-12 3:09
himmubhai12-Oct-12 3:09 
GeneralRe: How to change color (combo,Text etc) when enable=false Pin
Marco Bertschi12-Oct-12 4:53
protectorMarco Bertschi12-Oct-12 4:53 
GeneralRe: How to change color (combo,Text etc) when enable=false Pin
himmubhai12-Oct-12 6:13
himmubhai12-Oct-12 6:13 
QuestionCan someone explain this... Pin
DanielSheets12-Oct-12 2:34
DanielSheets12-Oct-12 2:34 
AnswerRe: Can someone explain this... Pin
Eddy Vluggen12-Oct-12 2:38
professionalEddy Vluggen12-Oct-12 2:38 
GeneralRe: Can someone explain this... Pin
DanielSheets12-Oct-12 2:40
DanielSheets12-Oct-12 2:40 
GeneralRe: Can someone explain this... Pin
Eddy Vluggen12-Oct-12 2:51
professionalEddy Vluggen12-Oct-12 2:51 
GeneralRe: Can someone explain this... Pin
DanielSheets12-Oct-12 2:55
DanielSheets12-Oct-12 2:55 
GeneralRe: Can someone explain this... Pin
OriginalGriff12-Oct-12 3:52
mveOriginalGriff12-Oct-12 3:52 
GeneralRe: Can someone explain this... Pin
DanielSheets19-Oct-12 1:31
DanielSheets19-Oct-12 1:31 
GeneralRe: Can someone explain this... Pin
OriginalGriff19-Oct-12 1:35
mveOriginalGriff19-Oct-12 1:35 

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.