private void llAddFootnoteInSelectedVariableForSelectedContent_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { PxContent pxContent = (PxContent)lbContents.SelectedItem; PxVariable variable = (PxVariable)lbVariables.SelectedItem; if (pxContent != null && variable != null) { var contentVariableFootnoteArray = (from vf in pxContent.ContentVariableFootnotes where vf.Variable == variable select vf).ToArray(); FootnoteDialog frmFootnote = new FootnoteDialog(); frmFootnote.Context = pxContent; pxContent.FootnoteVariable = "B"; if (contentVariableFootnoteArray.Count() == 0) { PxContentVariableFootnote contentVariableFootnote = (PxContentVariableFootnote)CreateContentVariableFootnote(pxContent); contentVariableFootnoteArray = (from vf in pxContent.ContentVariableFootnotes where vf.Variable == variable select vf).ToArray(); } frmFootnote.SetDataSource((PxFootnote[])contentVariableFootnoteArray); frmFootnote.AddFotnoteHandler = CreateContentVariableFootnote; frmFootnote.RemoveFootnoteHandler = RemoveContentVariableFootnote; frmFootnote.ShowDialog(); } else { MessageBox.Show("Select a content and a variable first!"); } }
private void btnContentDown_Click(object sender, EventArgs e) { int oldIndex = lbContents.SelectedIndex; int newIndex = Math.Min(lbContents.Items.Count - 1, oldIndex + 1); PxContent c = (PxContent)lbContents.SelectedItem; _table.Contents.RemoveAt(oldIndex); _table.Contents.Insert(newIndex, c); lbContents.SelectedIndex = newIndex; }
private void btnContentUp_Click(object sender, EventArgs e) { if (lbContents.SelectedItem != null) { int oldIndex = lbContents.SelectedIndex; int newIndex = Math.Max(0, oldIndex - 1); PxContent c = (PxContent)lbContents.SelectedItem; _table.Contents.RemoveAt(oldIndex); _table.Contents.Insert(newIndex, c); lbContents.SelectedIndex = newIndex; } }
private void btnRemoveContent_Click(object sender, EventArgs e) { if (lbContents.SelectedItem != null) { PxContent c = (PxContent)lbContents.SelectedItem; _table.Contents.Remove(c); if (!c.IsNew) { _table.RemovedContents.Add(c); } } }
private void btnAddContent_Click(object sender, EventArgs e) { PxContent c = new PxContent(); c.FootnoteValue = "N"; c.FootnoteTime = "N"; c.FootnoteVariable = "N"; c.FootnoteContents = "N"; c.Content = "New Content"; _table.Contents.Add(c); _table.MarkAsDirty(); lbContents.SelectedItem = c; pxContentBindingSource.DataSource = c; }
private void btnAddContentFootnote_Click(object sender, EventArgs e) { PxContent pxContent = (PxContent)lbContents.SelectedItem; if (pxContent != null) { FootnoteDialog frmFootnote = new FootnoteDialog(); frmFootnote.Context = pxContent; pxContent.FootnoteContents = "B"; if (pxContent.Footnotes.Count == 0) { PxContentFootnote contentFootnote = (PxContentFootnote)CreateContentFootnote(pxContent); } frmFootnote.SetDataSource((PxFootnote[])(pxContent).Footnotes.ToArray()); frmFootnote.AddFotnoteHandler = CreateContentFootnote; frmFootnote.RemoveFootnoteHandler = RemoveContentFootnote; frmFootnote.ShowDialog(); } else { MessageBox.Show("Select a content first!"); } }