Пример #1
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            Properties.Settings_AT ps = Properties.Settings_AT.Default;
            ps.Top  = this.Top;
            ps.Left = this.Left;


            if (this.WindowState == WindowState.Maximized)
            {
                ps.SizeToContent = 1;
            }
            else
            {
                ps.SizeToContent = 0;
                ps.Width         = this.Width;
                ps.Height        = this.Height;
            }

            ps.st1 = st1.Width.Value;
            ps.st2 = st2.Width.Value;
            ps.st3 = st3.Width.Value;
            ps.st4 = st4.Width.Value;
            ps.st5 = otdelka.Width.Value;
            ps.st6 = edizmer.Width.Value;
            ps.st7 = st7.Width.Value;
            ps.st8 = st8.Width.Value;
            ps.st9 = st9.Width.Value;

            ps.st11 = st11.Width;
            ps.st12 = st12.Width;
            ps.st13 = st13.Width;
            ps.st14 = st14.Width;

            /*
             * ps.kolonki =
             * st1.Width.ToString() + ";" +
             * st2.Width.ToString() + ";" +
             * st3.Width.ToString() + ";" +
             * st4.Width.ToString() + ";" +
             * otdelka.Width.ToString() + ";" +
             * edizmer.Width.ToString() + ";" +
             * st7.Width.ToString() + ";" +
             * st8.Width.ToString() + ";" +
             * st9.Width.ToString() + ";" +
             * st11.Width.ToString() + ";" +
             * st12.Width.ToString() + ";" +
             * st13.Width.ToString() + ";" +
             * st14.Width.ToString() + ";";
             */


            ps.Save();



            //pfrhsnbt
        }
Пример #2
0
        void loadpage()
        {
            log.Add("установим размеры окна окна");
            Properties.Settings_AT ps = Properties.Settings_AT.Default;
            if (ps.Top == -100)
            {
                this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            }
            else
            {
                this.Top  = ps.Top;
                this.Left = ps.Left;
            }
            if (ps.SizeToContent == 1)
            {
                this.WindowState = WindowState.Maximized;
            }
            else
            {
                this.Width  = ps.Width;
                this.Height = ps.Height;
            }
            /// string[] kolonki = ps.kolonki.Split(';');

            // st1.Width.Value= ps.st1;
            st1.Width     = new DataGridLength(ps.st1, DataGridLengthUnitType.Pixel); // = ;
            st2.Width     = new DataGridLength(ps.st2, DataGridLengthUnitType.Pixel); // = ;
            st3.Width     = new DataGridLength(ps.st3, DataGridLengthUnitType.Pixel); // = ;
            st4.Width     = new DataGridLength(ps.st4, DataGridLengthUnitType.Pixel); // = ;
            otdelka.Width = new DataGridLength(ps.st5, DataGridLengthUnitType.Pixel); // = ;
            edizmer.Width = new DataGridLength(ps.st6, DataGridLengthUnitType.Pixel); // = ;
            st7.Width     = new DataGridLength(ps.st7, DataGridLengthUnitType.Pixel); // = ;
            st8.Width     = new DataGridLength(ps.st8, DataGridLengthUnitType.Pixel); // = ;
            st9.Width     = new DataGridLength(ps.st9, DataGridLengthUnitType.Pixel); // = ;
            st11.Width    = ps.st11;
            st12.Width    = ps.st12;
            st13.Width    = ps.st13;
            st14.Width    = ps.st14;
        }