コード例 #1
0
ファイル: Program.cs プロジェクト: MatiasStorm/Diary
        static void DisplayEditor(string fileName, string headline)
        {
            Dictionary <string, List <string> > headlineTextPairs = DiaryFile.GetHeadlineTextPairs(fileName);
            List <string> lines = headlineTextPairs[headline];

            DisplayEditor(headline, lines);
            SaveChanges(headlineTextPairs, fileName);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: MatiasStorm/Diary
        static void ViewFile(string fileName)
        {
            ClearConsole();
            WriteMessage("Viewing file: " + fileName + " (Press a key to exit)\n");
            Dictionary <string, List <string> > headlineTextPairs = DiaryFile.GetHeadlineTextPairs(fileName);

            string[]        headlines = headlineTextPairs.Keys.ToArray();
            List <string>[] text      = headlineTextPairs.Values.ToArray();
            for (int i = 0; i < headlines.Length; i++)
            {
                string        headline  = headlines[i];
                List <string> paragraph = text[i];
                WriteMessage(headline + "\n");
                foreach (string line in paragraph)
                {
                    WriteMessage(line + "\n");
                }
                WriteMessage("\n");
            }
            WaitForKeyPress();
        }