Example #1
0
        public void PrintToConsole()
        {
            var helper = SqlSettingHelper.GetInstance();

            Console.WriteLine($"ConnectionString: {helper.connectionString}");

            Console.WriteLine("Bancos:");
            foreach (var b in helper.bancos)
            {
                Console.WriteLine(b);
            }

            Console.WriteLine("Servidores:");
            foreach (var s in helper.servidores)
            {
                Console.WriteLine(s);
            }

            foreach (var k in helper.servidoresToFile.Keys)
            {
                Console.WriteLine($"{k} mapeado para: {helper.servidoresToFile[k]}");
            }

            foreach (var k in helper.localScript.Keys)
            {
                Console.WriteLine($"Mapa de arquivos para: {k}");
                foreach (var l in helper.localScript[k].Keys)
                {
                    Console.WriteLine($"{k}, l: {l}, arquivo: {helper.localScript[k][l]}");
                }
            }
        }
Example #2
0
        public static SqlSettingHelper GetInstance()
        {
            if (LOG.IsTraceEnabled)
            {
                LOG.InitTrace(nameof(GetInstance));
            }

            if (SqlSettingHelper._instancia == null)
            {
                if (LOG.IsDebugEnabled)
                {
                    LOG.Debug("Iniciando instância de configuração...");
                }

                SqlSettingHelper._instancia = new SqlSettingHelper();

                if (LOG.IsDebugEnabled)
                {
                    LOG.Debug("..instância de configuração iniciada!");
                }
            }

            if (LOG.IsTraceEnabled)
            {
                LOG.EndTrace(nameof(GetInstance));
            }

            return(SqlSettingHelper._instancia);
        }