Ejemplo n.º 1
0
        public void Save(APP_CONFIG_KEY key, string value)
        {
            switch (key)
            {
            case APP_CONFIG_KEY.rmcComPort:
                this._config.AppSettings.Settings["rmcComPort"].Value = value;
                break;

            case APP_CONFIG_KEY.mtkComPort:
                this._config.AppSettings.Settings["mtkComPort"].Value = value;
                break;

            case APP_CONFIG_KEY.apxFileName:
                this._config.AppSettings.Settings["apxFileName"].Value = value;
                break;

            case APP_CONFIG_KEY.excelFileName:
                this._config.AppSettings.Settings["excelFileName"].Value = value;
                break;

            case APP_CONFIG_KEY.arduinoFileName:
                this._config.AppSettings.Settings["arduinoFileName"].Value = value;
                break;
            }
        }
Ejemplo n.º 2
0
        public string Get(APP_CONFIG_KEY key)
        {
            string result = string.Empty;

            switch (key)
            {
            case APP_CONFIG_KEY.rmcComPort:
                result = ConfigurationManager.AppSettings["rmcComPort"];
                break;

            case APP_CONFIG_KEY.mtkComPort:
                result = ConfigurationManager.AppSettings["mtkComPort"];
                break;

            case APP_CONFIG_KEY.apxFileName:
                result = ConfigurationManager.AppSettings["apxFileName"];
                break;

            case APP_CONFIG_KEY.excelFileName:
                result = ConfigurationManager.AppSettings["excelFileName"];
                break;

            case APP_CONFIG_KEY.arduinoFileName:
                result = ConfigurationManager.AppSettings["arduinoFileName"];
                break;
            }

            return(result);
        }