示例#1
0
        public static string DirectoryPath()
        {
            string result = "c:\totvs";

            Tag tag = new Tag("Path", "");

            result = ConfigAction.TagValue(Path.Combine(Directory.GetCurrentDirectory(), "RMTools.exe.config"), tag);
            if (result == "0")
            {
                CreateAppConfig();
                result = DirectoryPath();
            }
            return(result);
        }
示例#2
0
        public static void UpdateTags()
        {
            InitTags();
            string pathRMExeConfig = Path.Combine(Ambiente.Selected.pathRmnet, "RM.exe.config");
            string pathHostConfig  = Path.Combine(Ambiente.Selected.pathRmnet, "RM.Host.Service.exe.config");

            _actionsPath.Value               = ConfigAction.TagValue(pathRMExeConfig, _actionsPath);
            _apiPort.Value                   = ConfigAction.TagValue(pathHostConfig, _apiPort);
            _enableCompression.Value         = ConfigAction.TagValue(pathRMExeConfig, _enableCompression);
            _enableDynamicLocalization.Value = ConfigAction.TagValue(pathRMExeConfig, _enableDynamicLocalization);
            _host.Value                = ConfigAction.TagValue(pathRMExeConfig, _host);
            _httpPort.Value            = ConfigAction.TagValue(pathHostConfig, _httpPort);
            _jobServer3Camadas.Value   = ConfigAction.TagValue(pathRMExeConfig, _jobServer3Camadas);
            _libPath.Value             = ConfigAction.TagValue(pathRMExeConfig, _libPath);
            _localizationLaguage.Value = ConfigAction.TagValue(pathRMExeConfig, _localizationLaguage);
            _port.Value                = ConfigAction.TagValue(pathHostConfig, _port);
            _traceFileRMExe.Value      = ConfigAction.TagValue(pathRMExeConfig, _traceFileRMExe);
            _traceFileHost.Value       = ConfigAction.TagValue(pathHostConfig, _traceFileHost);
            _traceLs.Value             = ConfigAction.TagValue(pathHostConfig, _traceLs);
            _configPath.Value          = ConfigAction.TagValue(pathRMExeConfig, _configPath);
            _updateServer.Value        = ConfigAction.TagValue(pathRMExeConfig, _updateServer);
            _updateServerEnabled.Value = ConfigAction.TagValue(pathHostConfig, _updateServerEnabled);
            _defaultDb.Value           = ConfigAction.TagValue(pathHostConfig, _defaultDb);
            _fileServerPath.Value      = ConfigAction.TagValue(pathHostConfig, _fileServerPath);

            ActionsPath               = _actionsPath.Value;
            ApiPort                   = _apiPort.Value;
            EnableCompression         = ConvertBooleanValue(_enableCompression.Value);
            EnableDynamicLocalization = ConvertBooleanValue(_enableDynamicLocalization.Value);
            Host                = _host.Value;
            HttpPort            = _httpPort.Value;
            JobServer3Camadas   = ConvertBooleanValue(_jobServer3Camadas.Value);
            LibPath             = _libPath.Value;
            LocalizationLaguage = _localizationLaguage.Value;
            Port                = _port.Value;
            TraceFileHost       = ConvertBooleanValue(_traceFileHost.Value);
            TraceFileRMExe      = ConvertBooleanValue(_traceFileRMExe.Value);
            TraceLs             = ConvertBooleanValue(_traceLs.Value);
            ConfigPath          = _configPath.Value;
            DefaultDb           = _defaultDb.Value;
            UpdateServer        = _updateServer.Value;
            UpdateServerEnabled = ConvertBooleanValue(_updateServerEnabled.Value);
            FileServerPath      = _fileServerPath.Value;
        }
 private void btnSalvar_Click(object sender, EventArgs e)
 {
     ConfigAction.Update(Path.Combine(Directory.GetCurrentDirectory(), "RMTools.exe.config"), "Path", txtDiretorio.Text);
     this.Close();
 }
示例#4
0
        public static void ApplyConfig()
        {
            string pathRMExeConfig       = Path.Combine(Ambiente.Selected.pathRmnet, "RM.exe.config");
            string pathHostServiceConfig = Path.Combine(Ambiente.Selected.pathRmnet, "RM.Host.Service.exe.config");
            string pathHostAppConfig     = Path.Combine(Ambiente.Selected.pathRmnet, "RM.Host.exe.config");

            _actionsPath.Value               = ActionsPath;
            _apiPort.Value                   = ApiPort;
            _enableCompression.Value         = EnableCompression.ToString();
            _enableDynamicLocalization.Value = EnableDynamicLocalization.ToString();
            _host.Value                = Host;
            _httpPort.Value            = HttpPort;
            _jobServer3Camadas.Value   = JobServer3Camadas.ToString();
            _libPath.Value             = LibPath;
            _localizationLaguage.Value = LocalizationLaguage;
            _port.Value                = Port;
            _traceFileHost.Value       = TraceFileHost.ToString();
            _traceFileRMExe.Value      = TraceFileRMExe.ToString();
            _traceLs.Value             = TraceLs.ToString();
            _configPath.Value          = ConfigPath;
            _defaultDb.Value           = DefaultDb;
            _updateServer.Value        = UpdateServer;
            _updateServerEnabled.Value = UpdateServerEnabled.ToString();
            _fileServerPath.Value      = FileServerPath.ToString();

            ConfigAction.UpdateAll(_actionsPath, Ambiente.Selected.pathRmnet);
            ConfigAction.Update(_apiPort, pathHostServiceConfig);
            ConfigAction.Update(_apiPort, pathHostAppConfig);
            ConfigAction.UpdateAll(_enableCompression, Ambiente.Selected.pathRmnet);
            ConfigAction.UpdateAll(_enableDynamicLocalization, Ambiente.Selected.pathRmnet);
            ConfigAction.Update(_host, pathRMExeConfig);
            ConfigAction.Update(_httpPort, pathHostServiceConfig);
            ConfigAction.Update(_httpPort, pathHostAppConfig);
            ConfigAction.UpdateAll(_jobServer3Camadas, Ambiente.Selected.pathRmnet);
            ConfigAction.UpdateAll(_libPath, Ambiente.Selected.pathRmnet);
            ConfigAction.UpdateAll(_localizationLaguage, Ambiente.Selected.pathRmnet);
            ConfigAction.UpdateAll(_port, Ambiente.Selected.pathRmnet);
            ConfigAction.Update(_defaultDb, pathHostServiceConfig);
            ConfigAction.Update(_defaultDb, pathHostAppConfig);

            if (_jobServer3Camadas.Value.ToLower() == "true")
            {
                ConfigAction.Add(_fileServerPath, pathHostAppConfig);
                ConfigAction.Add(_fileServerPath, pathHostServiceConfig);
            }
            else
            {
                ConfigAction.Remove(_fileServerPath, pathHostAppConfig);
                ConfigAction.Remove(_fileServerPath, pathHostServiceConfig);
            }

            if (_updateServerEnabled.Value.ToLower() == "true")
            {
                ConfigAction.Remove(_updateServer, pathRMExeConfig);
                ConfigAction.Remove(_updateServerEnabled, pathHostAppConfig);
                ConfigAction.Remove(_updateServerEnabled, pathHostServiceConfig);

                ConfigAction.Add(_updateServer, pathRMExeConfig);
                ConfigAction.Add(_updateServerEnabled, pathHostAppConfig);
                ConfigAction.Add(_updateServerEnabled, pathHostServiceConfig);
            }
            else if (_updateServer.Value != "0" && _updateServer.Value != "")
            {
                ConfigAction.Remove(_updateServer, pathRMExeConfig);
                ConfigAction.Remove(_updateServerEnabled, pathHostAppConfig);
                ConfigAction.Remove(_updateServerEnabled, pathHostServiceConfig);

                ConfigAction.Add(_updateServer, pathRMExeConfig);
            }
            else
            {
                ConfigAction.Remove(_updateServer, pathRMExeConfig);
                ConfigAction.Remove(_updateServerEnabled, pathHostAppConfig);
                ConfigAction.Remove(_updateServerEnabled, pathHostServiceConfig);
            }


            if (_traceFileHost.Value.ToLower() == "true")
            {
                ConfigAction.Remove(_traceFileHost, pathHostServiceConfig);
                ConfigAction.Remove(_traceFileHost, pathHostAppConfig);

                ConfigAction.Add(_traceFileHost, pathHostServiceConfig);
                ConfigAction.Add(_traceFileHost, pathHostAppConfig);
            }
            else
            {
                ConfigAction.Remove(_traceFileHost, pathHostServiceConfig);
                ConfigAction.Remove(_traceFileHost, pathHostAppConfig);
            }
            if (_traceFileRMExe.Value.ToLower() == "true")
            {
                ConfigAction.Remove(_traceFileRMExe, pathRMExeConfig);
                ConfigAction.Add(_traceFileRMExe, pathRMExeConfig);
            }
            else
            {
                ConfigAction.Remove(_traceFileRMExe, pathRMExeConfig);
            }

            if (_traceLs.Value.ToLower() == "true")
            {
                ConfigAction.Remove(_traceLs, pathHostServiceConfig);
                ConfigAction.Remove(_traceLs, pathHostAppConfig);

                ConfigAction.Add(_traceLs, pathHostServiceConfig);
                ConfigAction.Add(_traceLs, pathHostAppConfig);
            }
            else
            {
                ConfigAction.Remove(_traceLs, pathHostServiceConfig);
                ConfigAction.Remove(_traceLs, pathHostAppConfig);
            }
        }