private static string GetAccessorKeyword(IMethodDefinition method) { switch (method.GetAccessorType()) { case AccessorType.EventAdder: return "add"; case AccessorType.EventRemover: return "remove"; case AccessorType.PropertySetter: return "set"; case AccessorType.PropertyGetter: return "get"; default: throw new ArgumentOutOfRangeException(); } }
private static string GetAccessorKeyword(IMethodDefinition method) { switch (method.GetAccessorType()) { case AccessorType.EventAdder: return("add"); case AccessorType.EventRemover: return("remove"); case AccessorType.PropertySetter: return("set"); case AccessorType.PropertyGetter: return("get"); default: throw new ArgumentOutOfRangeException(); } }
public static bool IsPropertyOrEventAccessor(this IMethodDefinition method) { return(method.GetAccessorType() != AccessorType.None); }