/// <summary> /// Initializes a new <see cref="OwnedFormSnapHelper"/> for the owned form and attaches snap behavior to it. /// </summary> /// <param name="ownedForm"> /// The <see cref="ConstrainedMoveResizeForm"/> to modify. /// </param> /// <exception cref="ArgumentNullException"> /// <paramref name="ownedForm"/> is null. /// </exception> public static OwnedFormSnapHelper AttachTo(ConstrainedMoveResizeForm ownedForm) { if (ownedForm == null) { throw new ArgumentNullException(nameof(ownedForm)); } return(new OwnedFormSnapHelper(ownedForm)); }
/// <summary> /// Initializes a new <see cref="MdiChildSnapHelper"/> for the MDI child and attaches snap behavior to it. /// </summary> /// <param name="mdiChild"> /// The <see cref="ConstrainedMoveResizeForm"/> MDI child to modify. /// </param> /// <exception cref="ArgumentNullException"> /// <paramref name="mdiChild"/> is null. /// </exception> public static MdiChildSnapHelper AttachTo(ConstrainedMoveResizeForm mdiChild) { if (mdiChild == null) { throw new ArgumentNullException(nameof(mdiChild)); } return(new MdiChildSnapHelper(mdiChild)); }
private OwnedFormSnapHelper(ConstrainedMoveResizeForm ownedForm) : base(ownedForm) { Form.ResizeBegin += OwnedForm_ResizeBegin; Form.ResizeEnd += OwnedForm_ResizeEnd; }
private MdiChildSnapHelper(ConstrainedMoveResizeForm mdiChild) : base(mdiChild) { Form.ResizeBegin += MdiChild_ResizeBegin; Form.ResizeEnd += MdiChild_ResizeEnd; }
protected SnapHelper(ConstrainedMoveResizeForm form) => Form = form;