private void miChangeLink_Click(object sender, EventArgs e) { ListViewItem item = lvEntity.FocusedItem; if (item != null && item.Tag != null) { GroupItem gitem = (GroupItem)item.Tag; string PtName = (gitem.Name.Length > 0) ? gitem.Name : lastPtName; string PtParam = (gitem.Param.Length > 1) ? gitem.Param : lastPtParam; PointSelector kind = (ParamGroupKind == ParamGroup.Trend) ? PointSelector.TrendPoints : PointSelector.TablePoints; using (frmEntitySelector form = new frmEntitySelector(PtName, PtParam, kind)) { if (form.ShowDialog() == DialogResult.OK) { int index = item.Index; lastPtName = form.EntityName; lastPtParam = form.EntityParam; updateGroupItem(gitem, lastPtName, lastPtParam); UpdateGroupItemsList(index); } } } }
private void tsmiChangeItem_Click(object sender, EventArgs e) { ColumnHeader curcolumn = (ColumnHeader)headerMenu.Tag; string[] args = curcolumn.Text.Split(new char[] { '.' }); string PtName = (args[0].Length > 0) ? args[0] : lastPtName; string PtParam = (args.Length > 1) ? args[1].ToString() : lastPtParam; GroupItem gi = (GroupItem)curcolumn.Tag; using (frmEntitySelector form = new frmEntitySelector(PtName, PtParam, PointSelector.TablePoints)) { if (form.ShowDialog() == DialogResult.OK) { lastPtName = form.EntityName; lastPtParam = form.EntityParam; updateGroupItem(gi, lastPtName, lastPtParam); curcolumn.Text = lastPtName + "." + lastPtParam; UpdateTableView(); } } }