protected override void OnDragDrop(DragEventArgs drgevent) { if (drgevent.Data.GetDataPresent(typeof(NetBibleViewer))) { try { // make sure the current user *can* edit this TB StoryEditor theSE; if (!_ctrlVerseParent.CheckForProperEditToken(out theSE)) { return; } NetBibleViewer theNetBibleViewer = (NetBibleViewer)drgevent.Data.GetData(typeof(NetBibleViewer)); SelectedText = theNetBibleViewer.ScriptureReference; Focus(); // indicate that we've changed something so that we don't exit without offering // to save. theSE.Modified = true; } catch { } // noop } }
private void toolStripAnchors_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(typeof(NetBibleViewer))) { // the only function of the button here is to add a slot to type a con note StoryEditor theSE; if (!CheckForProperEditToken(out theSE)) { return; } NetBibleViewer theNetBibleViewer = (NetBibleViewer)e.Data.GetData(typeof(NetBibleViewer)); AnchorData theAnchorData = _myAnchorsData.AddAnchorData(theNetBibleViewer.ScriptureReference, theNetBibleViewer.ScriptureReference); InitAnchorButton(toolStripAnchors, theAnchorData); // indicate that we've changed something so that we don't exit without offering // to save. theSE.Modified = true; } }
private void toolStripAnchors_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(typeof(NetBibleViewer))) { // the only function of the button here is to add a slot to type a con note StoryEditor theSE; if (!CheckForProperEditToken(out theSE)) { return; } NetBibleViewer theNetBibleViewer = (NetBibleViewer)e.Data.GetData(typeof(NetBibleViewer)); foreach (ToolStripButton btn in toolStripAnchors.Items) { if (btn.Text == theNetBibleViewer.ScriptureReference) { e.Effect = DragDropEffects.None; return; } } e.Effect = DragDropEffects.Link; } }