public string GetDelegateInfo (ITypeSymbol type)
{
if (type == null)
throw new ArgumentNullException ("type");
var t = type;
var result = new StringBuilder ();
var method = t.GetDelegateInvokeMethod ();
result.Append (GetTypeReferenceString (method.ReturnType));
if (BreakLineAfterReturnType) {
result.AppendLine ();
} else {
result.Append (" ");
}
result.Append (FilterEntityName (t.Name));
AppendTypeParameters (result, method.TypeParameters);
// TODO:
// if (document.GetOptionSet ().GetOption (CSharpFormattingOptions.SpaceBeforeDelegateDeclarationParentheses))
// result.Append (" ");
result.Append ('(');
AppendParameterList (
result,
method.Parameters,
false /* formattingOptions.SpaceBeforeDelegateDeclarationParameterComma */,
true /* formattingOptions.SpaceAfterDelegateDeclarationParameterComma*/,
false
);
result.Append (')');
return result.ToString ();
}