How to access a type's implemented static abstract interface members by having only a type and using the interface type itself? Any way to do that? I'm not talking about accessing static members via reflection.
example:
public interface ISomeInterface
{
static int SomeProperty {get; set;}
}
public class SomeClass : ISomeInterface
{
static abstract int SomeProperty {get; set;} = 2;
}
var implementingType = typeof(SomeClass);
ISomeInterface interface = /* How? */
Is there any way of getting the value without using the common way by using reflection to acces a static member like this
void Method {
var value = typeof(SomeClass).GetProperty("SomeProperty").GetValue(null);
value = typeof(ISomeInterface).GetProperty("SomeProperty").GetValue(null);
}
Casting is a concept which only works with instances so it cannot be used for Type definitions.