示例#1
0
        static void ReadConfiguration()
        {
            string file = Path.Combine(SteticMain.ConfigDir, "configuration.xml");

            Configuration = null;

            if (File.Exists(file))
            {
                try {
                    using (StreamReader sr = new StreamReader(file)) {
                        XmlSerializer ser = new XmlSerializer(typeof(Configuration));
                        Configuration = (Configuration)ser.Deserialize(sr);
                    }
                } catch {
                    // Ignore exceptions while reading the recents file
                }
            }

            if (Configuration != null)
            {
                MainWindow.Move(Configuration.WindowX, Configuration.WindowY);
                MainWindow.Resize(Configuration.WindowWidth, Configuration.WindowHeight);
                if (Configuration.WindowState == Gdk.WindowState.Maximized)
                {
                    MainWindow.Maximize();
                }
                else if (Configuration.WindowState == Gdk.WindowState.Iconified)
                {
                    MainWindow.Iconify();
                }
                SteticApp.ShowNonContainerWarning = Configuration.ShowNonContainerWarning;
            }
            else
            {
                Configuration = new Configuration();
            }
        }