public DlgHistoryProperty(CLHistory history) { this.InitializeComponent(); this.history = history; if (this.history != null) { this.labOrder.Text = history.Order.ToString(); string str = string.Empty; if (history.CellsRemark.Count > 0) { foreach (string str2 in history.CellsRemark) { str = str + str2 + ";"; } str = str.Substring(0, str.Length - 1); } this.txtCellsRemark.Text = str; this.txtCellSign.Text = history.CellSign.ToUpper(); this.txtCellDate.Text = history.CellDate.ToUpper(); this.textBox1.Text = history.CellDateFormat; this.chkTime.Checked = history.DateIncludeTime; this.cmbSizeModel.Items.Add("自动"); this.cmbSizeModel.Items.Add("拉伸"); this.cmbSizeModel.Items.Add("简单居中"); this.cmbSizeModel.Items.Add("居中"); this.cmbSizeModel.Text = this.history.SgnSizeMode; this.cmbSign.Text = history.EleSignature ? "是" : "否"; } }
private void btnProperty_Click(object sender, EventArgs e) { if (this.lvwHistory.SelectedItems.Count >= 1) { int num = 0; while (num < this.lstHistory.Count) { if (((CLHistory)this.lstHistory[num]).Order.ToString() == this.lvwHistory.SelectedItems[0].Text) { break; } num++; } CLHistory history = null; if (num < this.lstHistory.Count) { DlgHistoryProperty property; history = this.lstHistory[num] as CLHistory; try { property = new DlgHistoryProperty(history); } catch (Exception exception) { MessageBox.Show(exception.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (property.ShowDialog() == DialogResult.OK) { this.lstHistory[num] = property.History; this.FillListViewItem(this.lvwHistory.SelectedItems[0], history); } } } }
public DlgHistoryProperty(int order) { this.InitializeComponent(); this.history = new CLHistory(); this.history.Order = order; this.labOrder.Text = order.ToString(); this.chkTime.Checked = false; this.cmbSizeModel.Items.Add("自动"); this.cmbSizeModel.Items.Add("拉伸"); this.cmbSizeModel.Items.Add("简单居中"); this.cmbSizeModel.Items.Add("居中"); this.cmbSizeModel.Text = this.history.SgnSizeMode; this.cmbSign.SelectedIndex = 1; }
private void btnDelete_Click(object sender, EventArgs e) { if ((this.lvwHistory.SelectedItems.Count >= 1) && (MessageBox.Show("确定删除第" + this.lvwHistory.SelectedItems[0].Text + "个记录吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.No)) { int index = this.lvwHistory.SelectedIndices[0]; this.lstHistory.RemoveAt(index); this.lvwHistory.Items.RemoveAt(index); for (int i = index; i < this.lstHistory.Count; i++) { CLHistory history1 = (CLHistory)this.lstHistory[i]; history1.Order--; } for (int j = index; j < this.lvwHistory.Items.Count; j++) { this.lvwHistory.Items[j].Text = (j + 1).ToString(); } } }
private ListViewItem FillListViewItem(CLHistory history) { ListViewItem item = new ListViewItem(history.Order.ToString()); string text = string.Empty; if (history.CellsRemark.Count > 0) { foreach (string str2 in history.CellsRemark) { text = text + str2 + ";"; } text = text.Substring(0, text.Length - 1); } item.SubItems.Add(text); item.SubItems.Add(history.CellSign); item.SubItems.Add(history.CellDate); return(item); }
private void InitializeHistory() { this.lstHistory = new ArrayList(); OWC.Range after = this.GetRange(1, 1); Label_0014: after = this.Find("<修改记录>", after); if (after != null) { CLHistory history = new CLHistory(); try { PPCardCompiler.ExplainXml(after.Text.ToString(), history); } catch { goto Label_0014; } this.lstHistory.Add(history); goto Label_0014; } this.lstHistory.Sort(); }
private void btnDown_Click(object sender, EventArgs e) { if ((this.lvwHistory.Items.Count != 0) && (this.lvwHistory.SelectedIndices.Count != 0)) { int index = this.lvwHistory.SelectedIndices[0]; if (index != (this.lvwHistory.Items.Count - 1)) { int num2 = index + 1; ListViewItem item = this.lvwHistory.Items[num2]; this.lvwHistory.Items.Remove(item); int num3 = index + 1; item.Text = num3.ToString(); this.lvwHistory.Items.Insert(index, item); this.lvwHistory.Items[num2].Text = (num2 + 1).ToString(); this.lvwHistory.Items[num2].Selected = true; CLHistory history = this.lstHistory[index] as CLHistory; history.Order = num2 + 1; this.lstHistory[index] = this.lstHistory[num2]; ((CLHistory)this.lstHistory[index]).Order = index + 1; this.lstHistory[num2] = history; } } }