public override bool CreateNote(NoteSystem system, NoteSource source)
 {
     if (source.MatchesFileType(".jpg"))
     {
         NotePanel panel = new ImageNotePanel();
         system.AddNotePanel(panel);
         return(true);
     }
     if (source.MatchesFileType(".png"))
     {
         NotePanel panel = new ImageNotePanel();
         system.AddNotePanel(panel);
         return(true);
     }
     if (source.MatchesFileType(".gif"))
     {
         NotePanel panel = new ImageNotePanel();
         system.AddNotePanel(panel);
         return(true);
     }
     return(false);
 }
Пример #2
0
 public override bool CreateNote(NoteSystem system, NoteSource source)
 {
     if (source.MatchesFileType(".txt"))
     {
         TextNotePanel panel = new TextNotePanel();
         panel.SuspendLayout();
         //panel.txtContent.Location = new System.Drawing.Point(20, 20);
         //panel.txtContent.Visible = true;
         panel.Controls.Add(panel.txtContent);
         panel.ResumeLayout(false);
         using (System.IO.TextReader reader = new System.IO.StreamReader(source.GetStream()))
         {
             panel.txtContent.Text = reader.ReadToEnd();
             system.AddNotePanel(panel);
         }
         return(true);
     }
     return(false);
 }