コード例 #1
0
 private void LerArquivo(Editor editor)
 {
     using (var textReader = new StreamReader(ObterArquivo()))
     {
         editor.CodigoEmRuby = textReader.ReadToEnd();
         textReader.Close();
     }
 }
コード例 #2
0
 private void SalvarArquivo(Editor editor)
 {
     using (var textWriter = new StreamWriter(ObterArquivo()))
     {
         textWriter.Write(editor.CodigoEmRuby);
         textWriter.Close();
     }
 }
コード例 #3
0
        public ActionResult EditorRuby(string button, Editor editor)
        {
            if (button == "Alterar")
                SalvarArquivo(editor);
            else
                LerArquivo(editor);

            return View(editor);
        }