|
|
|
In this case we have only one usage of IMyControl.ID
public interface IMyControl { string ID { get; } } public sealed class MyControl2 : IMyControl { public string ID { get { return GetType().FullName; } } } public sealed class MyControl3 : System.Web.UI.Control { } public class MyClass { MyControl2 myControl2 = new MyControl2(); MyControl3 myControl3 = new MyControl3(); public MyClass() { string id; id = myControl2.ID; // Only one usage id = myControl3.ID; } } In this case R# find 3 usages public interface IMyControl { string ID { get; } } public class MyControl1 : System.Web.UI.Control, IMyControl { } public sealed class MyControl2 : IMyControl { public string ID { get { return GetType().FullName; } } } public sealed class MyControl3 : System.Web.UI.Control { } public class MyClass { System.Web.UI.Control myControl1 = new MyControl1(); MyControl2 myControl2 = new MyControl2(); MyControl3 myControl3 = new MyControl3(); public MyClass() { string id; id = myControl1.ID; id = myControl2.ID; id = myControl3.ID; } } but myControl3.ID - is not of implementation IMyControl (myControl3 is MyControl3 type and MyControl3 is sealed and has no base types which implement IMyControl. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
At this point, whenever you use Control.ID it may happen you are using IMyControl.ID.
It is called quasi-implementation, i.e. Control quasi-implements IMyControl for the ID property.
Is this the case?