Click here to Skip to main content
15,901,970 members
Home / Discussions / C#
   

C#

 
GeneralRe: Java Pin
VickyC#30-Aug-05 4:51
VickyC#30-Aug-05 4:51 
Questionadding a Palette to a Surface in DirectX Pin
silka_c#30-Aug-05 3:28
silka_c#30-Aug-05 3:28 
Questionsql connection string c# by coding Pin
bozoo30-Aug-05 2:23
bozoo30-Aug-05 2:23 
AnswerRe: sql connection string c# by coding Pin
Guffa30-Aug-05 2:34
Guffa30-Aug-05 2:34 
AnswerRe: sql connection string c# by coding Pin
jan larsen30-Aug-05 2:41
jan larsen30-Aug-05 2:41 
GeneralRe: sql connection string c# by coding Pin
bozoo30-Aug-05 20:34
bozoo30-Aug-05 20:34 
QuestionApplication versioning Pin
rmedo30-Aug-05 1:58
rmedo30-Aug-05 1:58 
QuestionInterfaces & Protected Methods Pin
phimix30-Aug-05 1:19
phimix30-Aug-05 1:19 
Aloha,

We would like to make some nice controls based on the classic ASP.NET webcontrols. In order to secure that this is done probably, we would like to define an interface which defines the following:

    interface IControl<br />
    {<br />
        void OnInit(EventArgs e);<br />
<br />
        void Render(HtmlTextWriter output);<br />
<br />
        string HeaderText<br />
        {<br />
            get;<br />
            set;<br />
        }<br />
    }


The interface definitions of OnInit() and Render() are supposed to remind the coder that he should override the methods in the ASP.NET webcontrol. The problem is that these methods are protected and we therefore get the following error:
'MyButton' does not implement interface member 'IControl.OnInit(System.EventArgs)'. 'MyButton.OnInit(System.EventArgs)' is either static, not public, or has the wrong return type.

The HeaderText property works perfectly, but that is because it is implemented as public in the MyButton class.

Any ideas? If possible, we would love to be able to define protected methods in our interface... and if not possible, we would love to hear about another way of forcing the coders to implement everything.

Thanks, Mads
AnswerRe: Interfaces &amp; Protected Methods Pin
leppie30-Aug-05 1:35
leppie30-Aug-05 1:35 
GeneralRe: Interfaces &amp; Protected Methods Pin
phimix30-Aug-05 2:42
phimix30-Aug-05 2:42 
GeneralRe: Interfaces &amp; Protected Methods Pin
leppie30-Aug-05 2:51
leppie30-Aug-05 2:51 
AnswerRe: Interfaces &amp; Protected Methods Pin
Guffa30-Aug-05 3:10
Guffa30-Aug-05 3:10 
GeneralRe: Interfaces &amp; Protected Methods Pin
phimix30-Aug-05 3:34
phimix30-Aug-05 3:34 
GeneralRe: Interfaces &amp; Protected Methods Pin
Guffa31-Aug-05 21:04
Guffa31-Aug-05 21:04 
GeneralRe: Interfaces &amp; Protected Methods Pin
phimix1-Sep-05 0:27
phimix1-Sep-05 0:27 
GeneralRe: Interfaces &amp; Protected Methods Pin
Guffa1-Sep-05 5:50
Guffa1-Sep-05 5:50 
QuestionImage zooming and displaying Pin
E6AD30-Aug-05 1:14
E6AD30-Aug-05 1:14 
AnswerRe: Image zooming and displaying Pin
Andrew Kirillov30-Aug-05 2:00
Andrew Kirillov30-Aug-05 2:00 
QuestionArray of PictureBoxes Pin
Yoyosch29-Aug-05 23:45
Yoyosch29-Aug-05 23:45 
AnswerRe: Array of PictureBoxes Pin
SeMartens30-Aug-05 3:55
SeMartens30-Aug-05 3:55 
Questionchukkykzn@msn.com Pin
chukkykzn29-Aug-05 23:27
chukkykzn29-Aug-05 23:27 
QuestionHow to change the default size of the PropertyGrid description pane? Pin
Gatchan29-Aug-05 23:03
Gatchan29-Aug-05 23:03 
Question&quot;Time bomb&quot; (trial version-like) Pin
gnjunge29-Aug-05 22:57
gnjunge29-Aug-05 22:57 
AnswerRe: &quot;Time bomb&quot; (trial version-like) Pin
Barm29-Aug-05 23:55
Barm29-Aug-05 23:55 
QuestionSHUTDOWN Pin
tatchung29-Aug-05 21:59
tatchung29-Aug-05 21:59 

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.