public static string GetSetupMethodName(IMethodSymbol methodSymbol)
 {
     if (methodSymbol.IsPropertyGetter())
     {
         return(methodSymbol.Name.Substring(4) + "_Get");
     }
     if (methodSymbol.IsPropertySetter())
     {
         return(methodSymbol.Name.Substring(4) + "_Set");
     }
     return(methodSymbol.GetGenericName());
 }
        public static string GetDelegateTypeName(IMethodSymbol methodSymbol, INamedTypeSymbol targetInterface)
        {
            string methodName = methodSymbol.Name;

            if (methodSymbol.IsPropertyGetter())
            {
                methodName = methodName.Substring(4) + "_Get";
            }
            else if (methodSymbol.IsPropertySetter())
            {
                methodName = methodName.Substring(4) + "_Set";
            }

            // only prefix inherited members
            if (targetInterface.GetGenericName() != methodSymbol.ContainingSymbol.GetGenericName())
            {
                methodName = SerializeName(methodSymbol.ContainingSymbol) + "_" + methodName;
            }

            if (methodSymbol.IsOrdinaryMethod() || methodSymbol.IsIndexerAccessor())
            {
                if (methodSymbol.Parameters.Any())
                {
                    methodName = methodName + "_" + string.Join("_", methodSymbol.Parameters.Select(SerializeName));
                }
            }

            methodName += "_Delegate";

            if (methodSymbol.IsGenericMethod)
            {
                methodName =
                    $"{methodName}<{string.Join(",", methodSymbol.TypeParameters.Select(symbol => symbol.Name))}>";
            }
            return(methodName);
        }
 private static bool IsPropertyGetter(IMethodSymbol method, Compilation compilation)
 {
     return(method.IsPropertyGetter());
 }
 public static bool IsPropertyAccessor(this IMethodSymbol methodSymbol)
 {
     return(methodSymbol.IsPropertyGetter() || methodSymbol.IsPropertySetter());
 }
 private static bool IsPropertyGetter(IMethodSymbol method, Compilation compilation)
 {
     return method.IsPropertyGetter();
 }