Ejemplo n.º 1
0
        public static void edit(CyFile file)
        {
            colorScreen();
            Console.Clear(); //clear
            Console.WriteLine("Editing " + file.getName());
            Console.WriteLine();
            bool   quit       = false;
            string input      = "";
            string newContent = "";

            while (!quit)
            {
                input = Console.ReadLine();
                if (input == ":wq")
                {
                    quit = true;
                }
                else
                {
                    newContent += input + "\n";
                }
            }
            file.setContents(newContent);
            Console.Clear();
            Console.WriteLine("Edited successfully.");
            recolor();
        }
Ejemplo n.º 2
0
 public static void read(CyFile file)
 {
     colorScreen();
     Console.Clear();
     Console.WriteLine("Reading " + file.getName());
     Console.WriteLine();
     Console.WriteLine(file.getContents());
     Console.ReadLine();
     Console.Clear();
     Console.WriteLine("Finished reading file.");
     recolor();
 }