示例#1
0
        private void LoadPaths()
        {
            comboBoxDestination.Items.Clear();
            IniLocations locations = new IniLocations();

            if (!locations.Init())
            {
                string error = "No FB2EPUBExt.INI file found in any of the paths";
                Program.Log.Error(error);
            }
            locations.Load();
            string defaultPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal),
                                              "My Books\\");

            if (!Directory.Exists(defaultPath))
            {
                try
                {
                    Directory.CreateDirectory(defaultPath);
                }
                catch (Exception)
                {
                }
            }
            comboBoxDestination.Items.Add(defaultPath);

            foreach (var location in locations.GetGuiLocations())
            {
                comboBoxDestination.Items.Add(location.Path);
            }
        }
 private void LoadPathsGroup()
 {
     listBoxPaths.Items.Clear();
     _locations.Load();
     foreach (var iniLocation in _locations)
     {
         listBoxPaths.Items.Add(iniLocation);
     }
     if (listBoxPaths.Items.Count > 0)
     {
         listBoxPaths.SelectedIndex = 0;
     }
     radioButtonSDEnabled.Enabled  = _locationsLoaded;
     radioButtonSDDisabled.Enabled = _locationsLoaded;
     radioButtonSDDisabled.Checked = (_locations.SingleDestination == -1);
     radioButtonSDEnabled.Checked  = (_locations.SingleDestination != -1);
     buttonPathNew.Enabled         = _locationsLoaded;
     buttonEdit.Enabled            = _locationsLoaded;
     UpdatePathsTabGui();
     UpdateSingleDestinationCombo();
 }
示例#3
0
        private void LoadPaths()
        {
            comboBoxDestination.Items.Clear();
            IniLocations locations = new IniLocations();
            if (!locations.Init())
            {
                string error = "No FB2EPUBExt.INI file found in any of the paths";
                Program.Log.Error(error);
            }
            locations.Load();
            string defaultPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal),
                                              "My Books\\");
            if (!Directory.Exists(defaultPath))
            {
                try
                {
                    Directory.CreateDirectory(defaultPath);
                }
                catch (Exception)
                {

                }
            }
            comboBoxDestination.Items.Add(defaultPath);

            foreach (var location in locations.GetGuiLocations())
            {
                comboBoxDestination.Items.Add(location.Path);
            }
        }