public string GetValue(string section, string key)
        {
            string defaultValue = "";

            if (!File.Exists(this.configFile))
            {
                return(defaultValue);
            }

            RVRMeander.Utils.IniFile ini = null;
            try
            {
                ini = new RVRMeander.Utils.IniFile(configFile);
                return(ini.GetValue(section, key, defaultValue));
            }
            catch (Exception ex)
            {
                //ErrorMessage = Resources.Strings.UnableToOpenConfigurationFile;
                //log.Error("{0}: {1}: {2}", ErrorMessage, configFile, ex.Message);
                return(defaultValue);
            }
            finally
            {
                if (ini != null)
                {
                    ini.Dispose();
                }
            }
        }
Beispiel #2
0
        private bool DoTheOpen(string dirPath)
        {
            string projStr = "";

            using (RVRMeander.Utils.IniFile config = new RVRMeander.Utils.IniFile(Path.Combine(dirPath, Const.Config_File_Name)))
            {
                projStr = config.GetValue(Const.Config_Section_Main, Const.Config_Key_Projection, "");
            }

            if (projStr.Length == 0)
            {
                MessageBox.Show("The selected directory is not valid");
                return(false);
            }

            this.eventMgr.Publish(new Core.Project.Events.PackageOpened()
            {
                PackagePath = dirPath, Projection = projStr
            });

            return(true);
        }