Beispiel #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="rhs"></param>
 public void set(PersistentWindowState rhs)
 {
     this.left        = rhs.left;
     this.top         = rhs.top;
     this.height      = rhs.height;
     this.width       = rhs.width;
     this.windowState = rhs.windowState;
 }
Beispiel #2
0
        /// <summary>
        ///
        ///
        /// </summary>
        /// <param name="_owner"></param>
        /// <param name="_state"></param>
        public WindowStateTracker(Form _owner, PersistentWindowState _state)
        {
            this.owner = _owner;
            this.state = _state;

            // subscribe to parent form's events
            owner.Closing += new System.ComponentModel.CancelEventHandler(OnClosing);
            owner.Resize  += new System.EventHandler(OnResize);
            owner.Move    += new System.EventHandler(OnMove);
            owner.Load    += new System.EventHandler(OnLoad);

            // get initial width and height in case form is never resized
            state.size = owner.Size;
        }