public Oranikle.Studio.Controls.CtrlStickyNote InsertSticky(System.Windows.Forms.Control parentControl, bool showSticky, System.Drawing.Point location, int width, int height, Oranikle.Studio.Controls.CtrlStickyNote.Colour colour, string text)
 {
     Oranikle.Studio.Controls.CtrlStickyNote ctrlStickyNote = new Oranikle.Studio.Controls.CtrlStickyNote();
     ctrlStickyNote.Location = location;
     if (width > 0)
     {
         ctrlStickyNote.Width = width;
     }
     if (height > 0)
     {
         ctrlStickyNote.Height = height;
     }
     ctrlStickyNote.CurrentColour = colour;
     ctrlStickyNote.Text          = text;
     //Add(ctrlStickyNote);
     if (showSticky)
     {
         parentControl.SuspendLayout();
     }
     IsShowingStickies = true;
     parentControl.Controls.Add(ctrlStickyNote);
     parentControl.Controls.SetChildIndex(ctrlStickyNote, 0);
     if (showSticky)
     {
         ctrlStickyNote.Show();
         parentControl.ResumeLayout();
     }
     return(ctrlStickyNote);
 }
Beispiel #2
0
 /// <summary>
 /// <paramref name="action"/>을 실행하는 동안 UI 업데이트를 중단
 /// </summary>
 public static void LockUpdate(Control control, Action action)
 {
     LockWindowUpdate(control.Handle);
     control.SuspendLayout();
     action?.Invoke();
     control.ResumeLayout(false);
     LockWindowUpdate(IntPtr.Zero);
 }
 public void DeleteSticky(Oranikle.Studio.Controls.CtrlStickyNote toDelete, System.Windows.Forms.Control parentControl, bool suspendAndResumeLayout)
 {
     //Remove(toDelete);
     if (suspendAndResumeLayout)
     {
         parentControl.SuspendLayout();
     }
     IsShowingStickies = true;
     parentControl.Controls.Remove(toDelete);
     toDelete.Dispose();
     if (suspendAndResumeLayout)
     {
         parentControl.ResumeLayout();
     }
 }