示例#1
0
 public void Import()
 {
     string[] files = Directory.GetFiles(Path);
     foreach (var file in files.Take(5))
     {
         var poem = new Poem
         {
             Path = file
         };
         poem.Import();
         PoemList.Add(poem);
     }
 }
示例#2
0
        public void ImportText()
        {
            string[] files = Directory.GetFiles(Path);
            foreach (var file in files)
            {
                if (file.ToLower().EndsWith("docx"))
                {
                    continue;
                }

                var poem = new Poem
                {
                    Path = file
                };
                poem.ImportText();
                PoemList.Add(poem);
            }
        }