What is the point of writing an interface without members ?
INamingContainer is one example in .NET Framework. And it’s described in MSDN as :
Identifies a container control that creates a new ID namespace within a Page object’s control hierarchy. This is a marker interface only.
Is it used for just this kind of blocks :
if (myControl is INamingContainer) { // do something }
Or are there other advantages of it ?
EDIT : It was called Marker Interface Pattern (thanks Preet)
This is to ensure that you can treat a collection of objects as the same type and then perform some operations on that type (You know that it must inherit from object).
Think of it like attributes. It’s type meta data.
You also might want to perform an operation on a known type (e.g. System.Web.UI.Control) but only perform that operation if the type inherits from a certain interface (e.g. INamingContainer).