Click here to Skip to main content
15,911,315 members
Home / Discussions / C#
   

C#

 
Questionstoring an array in a profile tag of web.config Pin
Zeeshan Riaz14-Jun-08 11:01
Zeeshan Riaz14-Jun-08 11:01 
AnswerRe: storing an array in a profile tag of web.config Pin
Christian Graus14-Jun-08 11:14
protectorChristian Graus14-Jun-08 11:14 
GeneralRe: storing an array in a profile tag of web.config Pin
Zeeshan Riaz14-Jun-08 11:22
Zeeshan Riaz14-Jun-08 11:22 
GeneralRe: storing an array in a profile tag of web.config Pin
Christian Graus14-Jun-08 11:24
protectorChristian Graus14-Jun-08 11:24 
GeneralRe: storing an array in a profile tag of web.config Pin
Zeeshan Riaz14-Jun-08 11:34
Zeeshan Riaz14-Jun-08 11:34 
GeneralRe: storing an array in a profile tag of web.config Pin
Christian Graus14-Jun-08 11:35
protectorChristian Graus14-Jun-08 11:35 
Questionsocket usage permission Pin
mahraja14-Jun-08 9:41
mahraja14-Jun-08 9:41 
QuestionExcel Help Pin
MumbleB14-Jun-08 6:22
MumbleB14-Jun-08 6:22 
AnswerRe: Excel Help Pin
parth.p14-Jun-08 16:06
parth.p14-Jun-08 16:06 
QuestionC# navigating to top of page Pin
nyjcr14-Jun-08 5:43
nyjcr14-Jun-08 5:43 
AnswerRe: C# navigating to top of page Pin
N a v a n e e t h14-Jun-08 5:55
N a v a n e e t h14-Jun-08 5:55 
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 

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.