I was inspired by mabster's blog post. Here is my proposed syntax for static extension methods (on types), static extension properties (on types), and extension properties.
// type extension method
// Pro: goes well with existing extension method
// Pro: goes well with proposed type extension property syntax
// Con: is a weird parameter syntax that is not really a parameter
public static int Foo3(static SomeStaticClass) { return 0; }
// type extension property
// Pro: goes well with existing extension method syntax
// Pro: goes well with proposed method-style type extension method
// Con: it makes a property look like a method; might be confusing for new users.
public static int Foo4(static SomeStaticClass) { get { return 0; } }
// instance extension property
// Pro: goes well with existing extension method
// Con: it makes a property look like a method; might be confusing for new users.
public static int Foo5(this SomeClass c) { get { return 0; } }
I was inspired by mabster's blog post. Here is my proposed syntax for static extension methods (on types), static extension properties (on types), and extension properties.
// type extension method
// Pro: goes well with existing extension method
// Pro: goes well with proposed type extension property syntax
// Con: is a weird parameter syntax that is not really a parameter
public static int Foo3(static SomeStaticClass) { return 0; }
// type extension property
// Pro: goes well with existing extension method syntax
// Pro: goes well with proposed method-style type extension method
// Con: it makes a property look like a method; might be confusing for new users.
public static int Foo4(static SomeStaticClass) { get { return 0; } }
// instance extension property
// Pro: goes well with existing extension method
// Con: it makes a property look like a method; might be confusing for new users.
public static int Foo5(this SomeClass c) { get { return 0; } }