private void ICAppendStringBtn_Click(object sender, EventArgs e) { string value = ICValueTxt.Text; int count = (int)ICCountTxt.Value; ICTanjiConstructer.BeginUpdate(); for (int i = 0; i < count; i++) { ICTanjiConstructer.AppendChunk(value); } ICTanjiConstructer.EndUpdate(); }
private void ICAppendBooleanBtn_Click(object sender, EventArgs e) { int count = (int)ICCountTxt.Value; bool value = (!string.IsNullOrEmpty(ICValueTxt.Text) && (ICValueTxt.Text[0] == 't' || ICValueTxt.Text[0] == '1')); ICTanjiConstructer.BeginUpdate(); for (int i = 0; i < count; i++) { ICTanjiConstructer.AppendChunk(value); } ICTanjiConstructer.EndUpdate(); }
private void ICAppendIntegerBtn_Click(object sender, EventArgs e) { int value; int count = (int)ICCountTxt.Value; if (int.TryParse(ICValueTxt.Text, out value) || string.IsNullOrWhiteSpace(ICValueTxt.Text)) { ICTanjiConstructer.BeginUpdate(); for (int i = 0; i < count; i++) { ICTanjiConstructer.AppendChunk(value); } ICTanjiConstructer.EndUpdate(); } else { MessageBox.Show(NotInt32, TanjiError, MessageBoxButtons.OK, MessageBoxIcon.Error); } }