Pet*_*r17 7 c# usability lambda visual-studio-2010 visual-studio
如何设置Visual Studio 2010,以便多行lambda函数看起来不丑,左边的所有空白区域?
dataView.CellFormatting += (s, e) =>
{
if ((e.ColumnIndex == 1)&&((dataView.SelectedCells.Count == 1)))
{
var scope = Scope.Instance;
var row = dataView.Rows[e.RowIndex];
var variable = row.DataBoundItem as Variable;
if (scope.Variables.Contains(variable))
{
dataView[e.ColumnIndex, e.RowIndex].Style.BackColor =
scope.GetGraph(variable).Color;
}
else
{
dataView[e.ColumnIndex, e.RowIndex].Style.BackColor = Color.White;
}
}
};
Run Code Online (Sandbox Code Playgroud)
现在很奇怪 \xe2\x80\x94 缩进不应该走那么远。
\n\n尝试将其剪切并粘贴到位,Visual Studio 应该会在粘贴时为您修复它。这就是我得到的:
\n\ndataView.CellFormatting += (s, e) =>\n{\n if ((e.ColumnIndex == 1) && ((dataView.SelectedCells.Count == 1)))\n {\n var scope = Scope.Instance;\n var row = dataView.Rows[e.RowIndex];\n var variable = row.DataBoundItem as Variable;\n\n if (scope.Variables.Contains(variable))\n {\n dataView[e.ColumnIndex, e.RowIndex].Style.BackColor =\n scope.GetGraph(variable).Color;\n }\n\n else\n {\n dataView[e.ColumnIndex, e.RowIndex].Style.BackColor = Color.White;\n }\n }\n};\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
1333 次 |
| 最近记录: |