Example #1
0
        /// <summary>
        /// Restores the position of the form.
        /// </summary>
        /// <param name="position"></param>
        private void RestorePosition(FormPosition position)
        {
            if (position == null)
            {
                throw new ArgumentNullException("position");
            }

            // defer...
            position.Restore(this);

            // event...
            this.OnPositionRestored();
        }
Example #2
0
        /// <summary>
        /// Restores the position of the form.
        /// </summary>
        private void RestorePosition()
        {
            if (Runtime.IsStarted == false)
            {
                return;
            }

            // load it...
            FormPosition position = FormPosition.FromXmlString(Runtime.Current.UserSettings.GetStringValue(this.FormSaveName, null, Cultures.System, OnNotFound.ReturnNull));

            if (position != null)
            {
                this.RestorePosition(position);
            }
        }
Example #3
0
        /// <summary>
        /// Saves the position of the form.
        /// </summary>
        private void SavePosition()
        {
            if (Runtime.IsStarted == false)
            {
                return;
            }

            // get the position...
            FormPosition position = new FormPosition(this);

            // save it...
            Runtime.Current.UserSettings[this.FormSaveName] = position.ToXmlString();

            // saved...
            this.OnPositionSaved();
        }