private void llAddFootnoteMainTValue_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { PxMainTable pxMainTable = SelectedMainTable; PxVariable variable = SelectedVariable; PxValue value = SelectedValue; if (variable != null && value != null) { var contentMainTableValueFootnoteArray = (from mtvf in pxMainTable.MainTableValueFootnotes where mtvf.Variable.Variable == variable.Variable && mtvf.Value.ValuePool == value.ValuePool && mtvf.Value.ValueCode == value.ValueCode select mtvf).ToArray(); FootnoteDialog frmFootnote = new FootnoteDialog(); frmFootnote.Context = pxMainTable; pxMainTable.MarkAsDirty(); if (contentMainTableValueFootnoteArray.Count() == 0) { PxMainTableValueFootnote mainTableValueFootnote = (PxMainTableValueFootnote)CreateMainTableValueFootnote(pxMainTable); contentMainTableValueFootnoteArray = (from vf in pxMainTable.MainTableValueFootnotes where vf.Variable == variable && vf.Value == value select vf).ToArray(); } frmFootnote.SetDataSource((PxFootnote[])contentMainTableValueFootnoteArray); frmFootnote.AddFotnoteHandler = CreateMainTableValueFootnote; frmFootnote.RemoveFootnoteHandler = RemoveMainTableValueFootnote; frmFootnote.ShowDialog(); } else { MessageBox.Show("Select a content, a variable and a value first!"); } }
void dgwValues_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.C) { DataObject d = dgwValues.GetClipboardContent(); Clipboard.SetDataObject(d); e.Handled = true; } else if (e.Control && e.KeyCode == Keys.V) { string s = Clipboard.GetText(); string[] lines = s.Split('\n'); int row = dgwValues.CurrentCell.RowIndex; int col = dgwValues.CurrentCell.ColumnIndex; dgwValues.CancelEdit(); foreach (string line in lines) { string[] cells = line.Split('\t'); if (cells.Length == 3) { PxValue val = new PxValue() { ValueCode = cells[0], ValueText = cells[1], ValueTextEnglish = cells[2].Replace("\r", "") }; //_valueSet.Values.EndNew(0); _valueSet.Values.CancelNew(0); _valueSet.Values.Add(val); } } //Add the pasted values as soruce for elimination List <Option> eliminationSource = Option.GetOptions("Elimination"); if (!String.IsNullOrWhiteSpace(_valueSet.Valueset)) { var eliminationOptions = (from v in _valueSet.Values select new Option() { Code = v.ValueCode, Text = v.ValueText } ).ToList(); eliminationSource.AddRange(eliminationOptions); } eliminationComboBox.DataSource = eliminationSource; } }
private void btnAddValuesFromValuepool_Click(object sender, EventArgs e) { ChooseValues frmChooseValues = new ChooseValues(); List <PxValue> valueList = VariableFacade.GetValuesByValuePool(_valueSet.ValuePool); foreach (var val in _valueSet.Values) { PxValue value = PxValueSet.GetValue(valueList, val.ValueCode); if (value != null) { valueList.Remove(value); } } frmChooseValues.DataSource = valueList; if (frmChooseValues.ShowDialog() == System.Windows.Forms.DialogResult.OK) { List <PxValue> selectedValues = frmChooseValues.SelectedValues; foreach (var sv in selectedValues) { _valueSet.Values.Add(sv); } } }