Click here to Skip to main content
16,011,530 members
Home / Discussions / C#
   

C#

 
AnswerRe: Use for attributes in C#? Pin
Colin Angus Mackay1-Dec-03 13:59
Colin Angus Mackay1-Dec-03 13:59 
GeneralManaged DirectSound resources Pin
Oyvind Bratland1-Dec-03 8:56
Oyvind Bratland1-Dec-03 8:56 
GeneralRe: Managed DirectSound resources Pin
Heath Stewart1-Dec-03 11:00
protectorHeath Stewart1-Dec-03 11:00 
GeneralRe: Managed DirectSound resources Pin
Oyvind Bratland1-Dec-03 21:07
Oyvind Bratland1-Dec-03 21:07 
GeneralRe: Managed DirectSound resources Pin
Heath Stewart2-Dec-03 2:51
protectorHeath Stewart2-Dec-03 2:51 
GeneralRe: Managed DirectSound resources Pin
Oyvind Bratland2-Dec-03 20:46
Oyvind Bratland2-Dec-03 20:46 
Generalimplementing IList for a sortedlist Pin
zuhx1-Dec-03 6:11
zuhx1-Dec-03 6:11 
GeneralRe: implementing IList for a sortedlist Pin
Heath Stewart1-Dec-03 6:41
protectorHeath Stewart1-Dec-03 6:41 
The compiler knows because the names match up to a single definition. If there are multiple methods with the same signature (based on name and param types) in various interfaces (for which a class can implement many) or in the base class (for which a class can extend only one), then you must use explicit interface methods (which answers another question):
public class MyClass : BaseClass, IMyInterface
{
  // In this example, both BaseClass and IMyInterface have a method called
  // Foo
  public override void Foo()
  {
    DoSomething();
  }
  // Notice that there's no access modifier below.
  void IMyInterface.Foo()
  {
    DoSomethingElse();
  }
}
This is really only necessary when the returns types differ or when you want a method based on one class or interface to do something different when from another interface. Many times, just let both BaseClass.Foo and IMyInterface.Foo refer to the same code (which the compiler handles just fine). Properties are probably benefited from this the most.

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: implementing IList for a sortedlist Pin
zuhx1-Dec-03 9:29
zuhx1-Dec-03 9:29 
GeneralRe: implementing IList for a sortedlist Pin
Heath Stewart1-Dec-03 10:30
protectorHeath Stewart1-Dec-03 10:30 
GeneralRe: implementing IList for a sortedlist Pin
zuhx2-Dec-03 5:51
zuhx2-Dec-03 5:51 
GeneralSHGFI Flag Info Pin
Tristan Rhodes1-Dec-03 4:02
Tristan Rhodes1-Dec-03 4:02 
GeneralRe: SHGFI Flag Info Pin
Heath Stewart1-Dec-03 6:35
protectorHeath Stewart1-Dec-03 6:35 
GeneralRe: SHGFI Flag Info Pin
Tristan Rhodes1-Dec-03 20:44
Tristan Rhodes1-Dec-03 20:44 
GeneralRe: SHGFI Flag Info Pin
Heath Stewart2-Dec-03 2:33
protectorHeath Stewart2-Dec-03 2:33 
GeneralUrgent!!! Using pointers in C# Pin
rasarit171-Dec-03 3:32
rasarit171-Dec-03 3:32 
GeneralRe: Urgent!!! Using pointers in C# Pin
leppie1-Dec-03 6:09
leppie1-Dec-03 6:09 
GeneralRe: Urgent!!! Using pointers in C# Pin
Heath Stewart1-Dec-03 6:45
protectorHeath Stewart1-Dec-03 6:45 
Generalnew webform inside another Pin
krisman1-Dec-03 2:36
krisman1-Dec-03 2:36 
GeneralRe: new webform inside another Pin
Heath Stewart1-Dec-03 2:54
protectorHeath Stewart1-Dec-03 2:54 
GeneralRe: new webform inside another Pin
krisman1-Dec-03 3:47
krisman1-Dec-03 3:47 
GeneralAll C# fan want to know Pin
lajiyo1-Dec-03 2:05
lajiyo1-Dec-03 2:05 
GeneralRe: All C# fan want to know Pin
Heath Stewart1-Dec-03 2:49
protectorHeath Stewart1-Dec-03 2:49 
GeneralRe: All C# fan want to know Pin
lajiyo1-Dec-03 22:23
lajiyo1-Dec-03 22:23 
GeneralRe: All C# fan want to know Pin
Heath Stewart2-Dec-03 2:59
protectorHeath Stewart2-Dec-03 2: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.