나는 그리드가 내 제거하려는 항목에서 특정 라인입니다. 그것은 루프에서,그 때가 두 번째 라인을 제거하고,품목에서 두 번째 라인에서 첫 번째 줄 수 있습니다. 는 방법을 조정할 수 있습니만 제거하는 줄을 내가 원하는가?
참고는 무엇을 하려고 해요 아무것도 보이지 않지만,게 첫 번째 줄을 이어 두 번째 해결 pow(b2),그리고 세 번째 줄에 나는 복사 두 번째 라인,하지만 해결 -4*5(-4*a).
이것은 미리 보기다.
이것 은 나의 코드를 팽창시키는 이러한 줄을 이해하기:
에 들어가 처음에 if(fields == null)
기 때문에 포로,그 후,가 else
:
for (int i = 0; i < qntLines; i++)
{
string field = lines[i].Substring(0, lines[i].IndexOf('#'));
string operation = lines[i].Substring(lines[i].IndexOf('#') + "#".Length);
CreateResultLine(field, operation, i, listTexts);
}
private void CreateResultLine(string field, string operation, int i, List<string> listTexts)
{
string[] fields = null;
List<string> texts = new List<string>();
string text = string.Empty;
dynamic textResult;
int count = new int();
if (field.Contains(','))
fields = field.Split(',', (char)StringSplitOptions.RemoveEmptyEntries);
if (fields == null)
{
text = listTexts[int.Parse(field)];
text = RemovePow(text);
texts.Add(text);
textResult = ExecuteOperation(texts, operation);
gridFrame.Children.RemoveAt(int.Parse(field) + 1);
gridFrame.Children.Add(new Label() { Text = textResult.ToString(), HorizontalTextAlignment = TextAlignment.Center,
TextColor = Color.Blue, HorizontalOptions = LayoutOptions.Center }, int.Parse(field) + 1, i);
}
else
{
foreach (var item in fields)
{
string noPow = string.Empty;
noPow = RemovePow(listTexts[int.Parse(item)]);
texts.Add(noPow);
++count;
}
textResult = ExecuteOperation(texts, operation);
for (int i2 = int.Parse(fields[0]); i2 <= int.Parse(fields[1]);)
{
gridFrame.Children.RemoveAt(int.Parse(fields[0]));
++i2;
}
gridFrame.Children.Add(new Label() { Text = textResult.ToString(), HorizontalTextAlignment = TextAlignment.Center,
TextColor = Color.Blue, HorizontalOptions = LayoutOptions.Center }, int.Parse(fields[0]) + 1, i);
}
}