Example #1
0
 /// <summary>
 /// Saves the window size and position to values in the variable bin.
 /// </summary>
 public static void SaveFormLayout(this Form me, IVariableBin var, string prefix)
 {
     var.Int[prefix + "width"] = me.Width;
     var.Int[prefix + "height"] = me.Height;
     var.Int[prefix + "left"] = me.Left;
     var.Int[prefix + "top"] = me.Top;
 }
Example #2
0
        /// <summary>
        /// Sets the window size and position to that specified in the variable bin.
        /// </summary>
        public static void ApplySavedFormLayout(this Form me, IVariableBin var, string prefix)
        {
            if (var.Int.ContainsKey(prefix+"width"))
                me.Width = var.Int[prefix + "width"];

            if (var.Int.ContainsKey(prefix + "height"))
                me.Height = var.Int[prefix + "height"];

            if (var.Int.ContainsKey(prefix + "left"))
                me.Left = var.Int[prefix + "left"];

            if (var.Int.ContainsKey(prefix + "top"))
                me.Top = var.Int[prefix + "top"];
        }