Click here to Skip to main content
15,897,518 members
Home / Discussions / C#
   

C#

 
Questionhow to can i run or execute another program from C# ... like winword for example ?? Pin
Zero coder14-Jun-08 3:44
Zero coder14-Jun-08 3:44 
AnswerRe: how to can i run or execute another program from C# ... like winword for example ?? Pin
Christian Graus14-Jun-08 3:47
protectorChristian Graus14-Jun-08 3:47 
AnswerRe: how to can i run or execute another program from C# ... like winword for example ?? [modified] Pin
erfi15-Jun-08 4:20
erfi15-Jun-08 4:20 
QuestionProblem for CCD Image Display in my Application Pin
PowerOn14-Jun-08 2:41
PowerOn14-Jun-08 2:41 
AnswerRe: Problem for CCD Image Display in my Application Pin
Christian Graus14-Jun-08 3:47
protectorChristian Graus14-Jun-08 3:47 
QuestionHelp: ReadPrint(winspool) & C# Pin
_CMD_14-Jun-08 2:26
_CMD_14-Jun-08 2:26 
QuestionInvoking SSIS PAckage from C# Pin
Member 400849213-Jun-08 22:40
Member 400849213-Jun-08 22:40 
QuestionNear-static class [modified] Pin
PIEBALDconsult13-Jun-08 13:25
mvePIEBALDconsult13-Jun-08 13:25 
I've gotten used to writing static classes. Today I was thinking of making one of my classes static, but couldn't because I also need to be able to derive from it. So I wanted to find a way of making it derivable but non-instantiatable.

Hmmm... I suppose I could give it a private constructor... oh, yeah, that's what we had to do waaaay back in .net 1 Big Grin | :-D


Well I just tried it, and found that the base class' constructor has to be (at least) protected (of course).
So I'm thinking of having it protected, but throw an Exception if it's ever called.


Clarification: I want to be able to derive, but the base class and all derivations must be singletons.


Does anyone else have a way of doing this?


Update: I just tried marking the base class' constructor as Obsolete; that also hinders derivation. Frown | :(

modified on Saturday, June 14, 2008 11:33 AM

AnswerRe: Near-static class Pin
MarkB77713-Jun-08 14:29
MarkB77713-Jun-08 14:29 
GeneralRe: Near-static class Pin
PIEBALDconsult13-Jun-08 15:28
mvePIEBALDconsult13-Jun-08 15:28 
GeneralRe: Near-static class Pin
MarkB77713-Jun-08 16:01
MarkB77713-Jun-08 16:01 
GeneralRe: Near-static class Pin
leppie13-Jun-08 21:56
leppie13-Jun-08 21:56 
GeneralRe: Near-static class Pin
PIEBALDconsult16-Jun-08 10:01
mvePIEBALDconsult16-Jun-08 10:01 
AnswerRe: Near-static class Pin
Ed.Poore13-Jun-08 20:50
Ed.Poore13-Jun-08 20:50 
GeneralRe: Near-static class Pin
PIEBALDconsult14-Jun-08 5:12
mvePIEBALDconsult14-Jun-08 5:12 
GeneralRe: Near-static class Pin
Ed.Poore14-Jun-08 8:12
Ed.Poore14-Jun-08 8:12 
GeneralRe: Near-static class Pin
PIEBALDconsult14-Jun-08 18:45
mvePIEBALDconsult14-Jun-08 18:45 
GeneralRe: Near-static class Pin
Ed.Poore14-Jun-08 21:18
Ed.Poore14-Jun-08 21:18 
GeneralRe: Near-static class Pin
PIEBALDconsult15-Jun-08 7:45
mvePIEBALDconsult15-Jun-08 7:45 
GeneralRe: Near-static class Pin
Ed.Poore15-Jun-08 9:08
Ed.Poore15-Jun-08 9:08 
GeneralRe: Near-static class Pin
PIEBALDconsult16-Jun-08 11:05
mvePIEBALDconsult16-Jun-08 11:05 
GeneralRe: Near-static class Pin
Ed.Poore16-Jun-08 11:15
Ed.Poore16-Jun-08 11:15 
GeneralRe: Near-static class Pin
PIEBALDconsult16-Jun-08 12:41
mvePIEBALDconsult16-Jun-08 12:41 
GeneralRe: Near-static class Pin
Ed.Poore16-Jun-08 13:21
Ed.Poore16-Jun-08 13:21 
GeneralRe: Near-static class Pin
PIEBALDconsult16-Jun-08 14:01
mvePIEBALDconsult16-Jun-08 14:01 

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.