Click here to Skip to main content
15,902,854 members
Home / Discussions / C#
   

C#

 
GeneralRe: Dialog with ProgressBar & label not working correctly Pin
Zoltan Balazs20-Mar-07 9:29
Zoltan Balazs20-Mar-07 9:29 
GeneralRe: Dialog with ProgressBar & label not working correctly Pin
Dave Kreskowiak20-Mar-07 12:24
mveDave Kreskowiak20-Mar-07 12:24 
GeneralRe: Dialog with ProgressBar & label not working correctly Pin
kozu20-Mar-07 13:32
kozu20-Mar-07 13:32 
QuestionListViewItemCollection's implementation of interfaces... Pin
Shy Agam20-Mar-07 7:39
Shy Agam20-Mar-07 7:39 
AnswerRe: ListViewItemCollection's implementation of interfaces... [modified] Pin
Edmundisme20-Mar-07 8:32
Edmundisme20-Mar-07 8:32 
GeneralRe: ListViewItemCollection's implementation of interfaces... [modified] Pin
Shy Agam20-Mar-07 9:01
Shy Agam20-Mar-07 9:01 
GeneralRe: ListViewItemCollection's implementation of interfaces... Pin
Shy Agam20-Mar-07 9:25
Shy Agam20-Mar-07 9:25 
AnswerRe: ListViewItemCollection's implementation of interfaces... Pin
Shy Agam20-Mar-07 10:29
Shy Agam20-Mar-07 10:29 
Well... I've found the solution...

When looking at the Object Browser I've noticed that no access modifiers were declared for all of the IList methods which ListViewItemCollection implements.
For example: int Add(object value)

After a little journy of trail and error, I figured that if I combine explicit implementation (i.e. writing the name of the interface and a dot before each method name, like so: IList.<Method Name>), and omit any access modifier, the method would not be accessible.

So now my code looks like this:
public ImageComboItem Add(string text, int imageIndex)
{
    // Do stuff
}
/* Other overloads here */
int IList.Add(object value)
{
    if (!(value is ImageComboItem))
        throw new InvalidCastException(...);

    // Do stuff
}
Of course the IList.Add() implementation is meaningless, as the method is not accessible from the outside...

Further more, if I add the private modifier, the compiler complains that private is not valid for this item.
However when I omit the access modifiers, the Object Browser shows that the method IS INDEED private...

Can anyone explain this behavior?
What's the purpose of this ability?

Thanks in advance,
Shy.
GeneralRe: ListViewItemCollection's implementation of interfaces... Pin
Edmundisme20-Mar-07 11:04
Edmundisme20-Mar-07 11:04 
GeneralRe: ListViewItemCollection's implementation of interfaces... Pin
Shy Agam20-Mar-07 11:06
Shy Agam20-Mar-07 11:06 
QuestionProject Namespace/Folder setup Question Pin
jubilanttiger20-Mar-07 7:12
jubilanttiger20-Mar-07 7:12 
QuestionGridview with dropdownlist. Pin
peter.bellen@qsm-europe.com20-Mar-07 7:06
peter.bellen@qsm-europe.com20-Mar-07 7:06 
QuestionExtend FileDialog Class Pin
aamir22au20-Mar-07 6:20
aamir22au20-Mar-07 6:20 
QuestionMultiThreading Error in C# Pin
Ollie198620-Mar-07 6:13
Ollie198620-Mar-07 6:13 
AnswerBad Ram? Pin
Ennis Ray Lynch, Jr.20-Mar-07 7:21
Ennis Ray Lynch, Jr.20-Mar-07 7:21 
GeneralRe: Bad Ram? Pin
Ollie198620-Mar-07 11:53
Ollie198620-Mar-07 11:53 
GeneralRe: Bad Ram? Pin
Ennis Ray Lynch, Jr.20-Mar-07 12:23
Ennis Ray Lynch, Jr.20-Mar-07 12:23 
QuestionRe: Bad Ram? Pin
Ollie198620-Mar-07 12:26
Ollie198620-Mar-07 12:26 
QuestionDesign-Time code debugging... Pin
Shy Agam20-Mar-07 6:12
Shy Agam20-Mar-07 6:12 
AnswerRe: Design-Time code debugging... Pin
Ollie198620-Mar-07 6:15
Ollie198620-Mar-07 6:15 
AnswerRe: Design-Time code debugging... Pin
Dave Kreskowiak20-Mar-07 6:28
mveDave Kreskowiak20-Mar-07 6:28 
AnswerRe: Design-Time code debugging... Pin
Shy Agam20-Mar-07 7:45
Shy Agam20-Mar-07 7:45 
GeneralRe: Design-Time code debugging... Pin
Zoltan Balazs20-Mar-07 9:37
Zoltan Balazs20-Mar-07 9:37 
GeneralRe: Design-Time code debugging... Pin
Shy Agam20-Mar-07 10:47
Shy Agam20-Mar-07 10:47 
QuestionImplement C++ in C# projects Pin
laura131620-Mar-07 6:08
laura131620-Mar-07 6:08 

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.