public void CarregaMemoriaCalculo()
        {
            List<MaquinaInequacoesServiceReference.Variavel> variaveis = new List<MaquinaInequacoesServiceReference.Variavel>();
            MaquinaInequacoesServiceClient telaFuncaoParse = new MaquinaInequacoesServiceClient();
            foreach (string line in textBox3.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None))
            {
                if (line != string.Empty && line.Substring(0, 2) != "//")
                {
                    string[] valores = line.Split('=');
                    string varName = valores[0];

                    MaquinaInequacoesServiceReference.Variavel varRepetida = variaveis.Where(v => v.Nome == varName).FirstOrDefault();
                    if (varRepetida != null)
                    {
                        MessageBox.Show("Variável repetida na memória de cáclulo: " + varName);
                        break;
                    }

                    KeyValuePair<MaquinaInequacoesServiceReference.TipoDado, object> varTypeValue = telaFuncaoParse.ParseTipoVariavelValor(line, valores);
                    MaquinaInequacoesServiceReference.Variavel variavel = new MaquinaInequacoesServiceReference.Variavel();
                    variavel.Nome = varName;
                    variavel.TipoDado = varTypeValue.Key;
                    variavel.Valor = varTypeValue.Value;
                    variaveis.Add(variavel);
                }
            }

            dataGridView1.DataSource = null;
            dataGridView1.DataSource = variaveis;
        }
 private void button5_Click(object sender, EventArgs e)
 {
     MaquinaInequacoesServiceClient maquinaInequacoesServiceClient = new MaquinaInequacoesServiceClient();
     maquinaInequacoesServiceClient.ShowDialog();
 }
        public void CarregarListaDecisoesDoArquivo(string fileName)
        {
            System.IO.StreamReader sr = new System.IO.StreamReader(File.OpenRead(fileName), Encoding.Default, true);
            MaquinaInequacoesServiceClient telaFuncaoParse = new MaquinaInequacoesServiceClient();

            Funcao funcao = new Funcao();
            funcao.Nome = fileName.Replace(GetCaminhoBaseArquivosTeste() + @"\ValidacaoLimites\MemoriaCalculo_ListasDecisoes\", string.Empty).Replace("-LD.txt", string.Empty);

            List<MaquinaInequacoesServiceReference.Decisao> decisoes = new List<MaquinaInequacoesServiceReference.Decisao>();

            while (sr.Peek() != -1)
            {
                string line = sr.ReadLine().Trim();
                if (line != string.Empty && line.Substring(0, 2) != "//")
                {
                    KeyValuePair<string, string> inequacaoBlocoAcao = ParseInequacaoBlocoAcao(line);
                    string inequacao = inequacaoBlocoAcao.Key;
                    string blocoAcao = inequacaoBlocoAcao.Value;

                    MaquinaInequacoesServiceReference.Decisao decisao = new MaquinaInequacoesServiceReference.Decisao();
                    decisao.Inequacao = inequacao;
                    decisao.BlocoDeAcao = blocoAcao;
                    decisoes.Add(decisao);
                }
            }

            if (funcao.ListaDecisoes == null)
                funcao.ListaDecisoes = new MaquinaInequacoesServiceReference.ListaDecisoes();

            funcao.ListaDecisoes.Decisoes = decisoes.ToArray();
            //funcao.VariavelRetorno = varRetorno;
            Funcoes.Add(funcao);
        }
        public void CarregarMemoriaDeCalculoDoArquivo(string fileName)
        {
            System.IO.StreamReader sr = new System.IO.StreamReader(File.OpenRead(fileName), Encoding.Default, true);
            MaquinaInequacoesServiceClient telaFuncaoParse = new MaquinaInequacoesServiceClient();

            while (sr.Peek() != -1)
            {
                string line = sr.ReadLine().Trim();
                if (line != string.Empty && line.Substring(0, 2) != "//")
                {
                    string[] valores = line.Split('=');
                    string varName = valores[0];

                    MaquinaInequacoesServiceReference.Variavel varRepetida = variaveis.Where(v => v.Nome.Trim().ToLower() == varName.Trim().ToLower()).FirstOrDefault();
                    if (varRepetida == null)
                    {
                        KeyValuePair<MaquinaInequacoesServiceReference.TipoDado, object> varTypeValue = telaFuncaoParse.ParseTipoVariavelValor(line, valores);
                        MaquinaInequacoesServiceReference.Variavel variavel = new MaquinaInequacoesServiceReference.Variavel();
                        variavel.Nome = varName;
                        variavel.TipoDado = varTypeValue.Key;
                        variavel.Valor = varTypeValue.Value;
                        variaveis.Add(variavel);
                    }
                }
            }
        }