void buttonDragDropHandle_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) { if (e.Data.GetDataPresent(typeof(ConsultNoteControl))) { ConsultNoteControl theCNC = (ConsultNoteControl)e.Data.GetData(typeof(ConsultNoteControl)); System.Diagnostics.Debug.Assert((sender is Button) && (sender == buttonDragDropHandle) && (theCNC.ParentControl != null) && (theCNC.ParentControl is ConsultNotesControl)); ConsultNoteDataConverter theMovingCNDC = theCNC._myCNDC; theCNC._myCollection.Remove(theMovingCNDC); _theCNsDC.Insert(0, theMovingCNDC); StoryEditor theSE = (StoryEditor)FindForm(); theSE.ReInitConsultNotesPane(_theCNsDC); } }
public ConsultNotesControl(StoryEditor theSE, LineFlowLayoutPanel parentFlowLayoutPanel, StoryStageLogic storyStageLogic, ConsultNotesDataConverter aCNsDC, int nVerseNumber, TeamMemberData.UserTypes eLoggedOnMemberType) : base(storyStageLogic, nVerseNumber, theSE, parentFlowLayoutPanel) { _theCNsDC = aCNsDC; InitializeComponent(); tableLayoutPanel.SuspendLayout(); SuspendLayout(); labelReference.Text = (VerseNumber == 0) ? CstrZerothVerseName : CstrVerseName + VerseNumber; tableLayoutPanel.Controls.Add(labelReference, 0, 0); tableLayoutPanel.Controls.Add(buttonDragDropHandle, 1, 0); if (aCNsDC.Count > 0) { int nRowIndex = 1; foreach (ConsultNoteDataConverter aCNDC in aCNsDC) { if (aCNDC.Visible || theSE.hiddenVersesToolStripMenuItem.Checked) { ConsultNoteControl aCNCtrl = new ConsultNoteControl(this, storyStageLogic, aCNsDC, aCNDC, eLoggedOnMemberType); aCNCtrl.Name = CstrFieldNameConsultantNote + nRowIndex; aCNCtrl.ParentControl = this; InsertRow(nRowIndex); tableLayoutPanel.SetColumnSpan(aCNCtrl, 2); tableLayoutPanel.Controls.Add(aCNCtrl, 0, nRowIndex); nRowIndex++; } } } tableLayoutPanel.ResumeLayout(false); ResumeLayout(false); }