/// <summary> /// Initializes a new instance of the <see cref="NuGenUISnap"/> class. /// </summary> /// <exception cref="ArgumentNullException"> /// <para><paramref name="stickyForm"/> is <see langword="null"/>.</para> /// -or- /// <para><paramref name="owner"/> is <see langword="null"/>.</para> /// </exception> public WndManager(Form stickyForm, NuGenUISnap owner) { if (stickyForm == null) { throw new ArgumentNullException("stickyForm"); } if (owner == null) { throw new ArgumentNullException("owner"); } _resizingForm = false; _movingForm = false; _originalForm = stickyForm; _owner = owner; _formBounds = Rectangle.Empty; _formOffsetRect = Rectangle.Empty; _formOffsetPoint = Point.Empty; _primaryOffset = Point.Empty; _mousePosition = Point.Empty; _defaultMessageProcessor = new ProcessMessage(DefaultMsgProcessor); _moveMessageProcessor = new ProcessMessage(MoveMsgProcessor); _resizeMessageProcessor = new ProcessMessage(ResizeMsgProcessor); _messageProcessor = _defaultMessageProcessor; AssignHandle(_originalForm.Handle); _originalForm.HandleCreated += delegate { AssignHandle(_originalForm.Handle); }; }