Beispiel #1
0
        private void LoadSettings()
        {
            fMRUFiles.Clear();

            try {
                string  iniPath = AppHost.GetAppDataPathStatic() + "GEDKeeper2.ini";
                IniFile ini     = new IniFile(iniPath);
                try {
                    int interfaceLang = (ushort)ini.ReadInteger("Common", "InterfaceLang", 0);
                    GlobalOptions.LoadMRUFromFile(ini, fMRUFiles);

                    GlobalOptions.Instance.FindLanguages();
                    GlobalOptions.Instance.LoadLanguage(interfaceLang);
                } finally {
                    ini.Dispose();
                }
            } catch (Exception ex) {
                Logger.WriteError("GKTray.LoadSettings()", ex);
            }

            fRecentFiles.MenuItems.Clear();
            int num = fMRUFiles.Count;

            for (int i = 0; i < num; i++)
            {
                var    mf = fMRUFiles[i];
                string fn = mf.FileName;

                MenuItem mi = new MenuItem(fn);
                mi.Tag    = mf;
                mi.Click += MRUFileClick;
                fRecentFiles.MenuItems.Add(mi);
            }
            fRecentFiles.Enabled = (num > 0);
        }