Exemplo n.º 1
0
Arquivo: Window.cs Projeto: MrJoe/lat
        void LoadPreference(String key)
        {
            object val = Preferences.Get(key);

            if (val == null)
            {
                if (key == Preferences.MAIN_WINDOW_HPANED)
                {
                    hpaned1.Position = 250;
                }

                return;
            }

            Log.Debug("Setting {0} to {1}", key, val);

            switch (key)
            {
            case Preferences.MAIN_WINDOW_MAXIMIZED:
                if ((bool)val)
                {
                    mainWindow.Maximize();
                }
                else
                {
                    mainWindow.Unmaximize();
                }
                break;

            case Preferences.MAIN_WINDOW_X:
            case Preferences.MAIN_WINDOW_Y:
                mainWindow.Move((int)Preferences.Get(Preferences.MAIN_WINDOW_X),
                                (int)Preferences.Get(Preferences.MAIN_WINDOW_Y));
                break;

            case Preferences.MAIN_WINDOW_WIDTH:
            case Preferences.MAIN_WINDOW_HEIGHT:
                mainWindow.SetDefaultSize((int)Preferences.Get(Preferences.MAIN_WINDOW_WIDTH),
                                          (int)Preferences.Get(Preferences.MAIN_WINDOW_HEIGHT));

                mainWindow.ReshowWithInitialSize();
                break;

            case Preferences.MAIN_WINDOW_HPANED:
                hpaned1.Position = (int)Preferences.Get(Preferences.MAIN_WINDOW_HPANED);
                break;

            case Preferences.BROWSER_SELECTION:
                ldapTreeView.BrowserSelectionMethod = (int)val;
                break;
            }
        }