public string GetArrayIndexerMarkup (IArrayTypeSymbol arrayType)
{
if (arrayType == null)
throw new ArgumentNullException ("arrayType");
var result = new StringBuilder ();
result.Append (GetTypeReferenceString (arrayType.ElementType));
if (BreakLineAfterReturnType) {
result.AppendLine ();
} else {
result.Append (" ");
}
result.Append (Highlight ("this", colorStyle.KeywordAccessors));
result.Append ("[");
for (int i = 0; i < arrayType.Rank; i++) {
if (i > 0)
result.Append (", ");
var doHighightParameter = i == HighlightParameter;
if (doHighightParameter)
result.Append ("<u>");
result.Append (Highlight ("int ", colorStyle.KeywordTypes));
result.Append (arrayType.Rank == 1 ? "index" : "i" + (i + 1));
if (doHighightParameter)
result.Append ("</u>");
}
result.Append ("]");
result.Append (" {");
result.Append (Highlight (" get", colorStyle.KeywordProperty) + ";");
result.Append (Highlight (" set", colorStyle.KeywordProperty) + ";");
result.Append (" }");
return result.ToString ();
}