| TypeName | SA1111ClosingParenthesisMustBeOnLineOfLastParameter |
| CheckId | SA1111 |
| Category | Readability Rules |
The closing parenthesis or bracket in a call to a C# method or indexer, or the declaration of a method or indexer, is not placed on the same line as the last parameter.
A violation of this rule occurs when the closing bracket of a method or indexer call or declaration is not placed on the same line as the last parameter. The following examples show correct placement of the bracket:
Constructor invocations and object creation expressions, including target-typed new, are covered by this rule as well. The closing ) for these expressions should appear on the same line as the final argument when one exists.
public string JoinName(string first, string last)
{
string name = JoinStrings(
first,
last);
}
public int this[int x]
{
get { return this.items[x]; }
}To fix a violation of this rule, ensure that the closing bracket is placed on the same line as the last parameter.
[SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1111:ClosingParenthesisMustBeOnLineOfLastParameter", Justification = "Reviewed.")]#pragma warning disable SA1111 // ClosingParenthesisMustBeOnLineOfLastParameter
#pragma warning restore SA1111 // ClosingParenthesisMustBeOnLineOfLastParameter