Are there methods with parameters of interface type in the standard library?

S

Stefan Ram

Are there any methods in the standard .NET library that have
parameters of an interface type?

(Preferably, simple methods with only one parametersthat
can be called without many preparations and can be easily
understood by beginners.)
 
A

Arne Vajhøj

Are there any methods in the standard .NET library that have
parameters of an interface type?

(Preferably, simple methods with only one parametersthat
can be called without many preparations and can be easily
understood by beginners.)

System.Collections.Generic.List<> have some methods
that take an IComparer<> parameter.

But in general .NET does not use as much interfaces
as Java.

Arne
 
J

Jeff Johnson

Are there any methods in the standard .NET library that have
parameters of an interface type?

(Preferably, simple methods with only one parametersthat
can be called without many preparations and can be easily
understood by beginners.)

I doubt this fits your "preferable" criteria, but String.Format() and
String.ToString() have overloads that take an IFormatProvider parameter.
(Doesn't String.ToString() sound like the most useless method EVER?)

Also, the TypeConverter class has several method overloads which take an
ITypeDescriptorContext object. But that whole System.ComponentModel
namespace would probably make a beginner's head explode....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top