示例#1
0
 public void CreateNote(NoteSource source)
 {
     foreach (NoteFactory factory in NoteFactories)
     {
         if (factory.CreateNote(this, source))
         {
             break;
         }
     }
 }
 public override bool CreateNote(NoteSystem system, NoteSource source)
 {
     if (source.MatchesFileType(".whlnk"))
     {
         string         name         = "get name from .whlnk file;";
         HTTPNoteSource linkedSource = new HTTPNoteSource(system);
         linkedSource.SetName(name);
         SetFileTypeFromMIMEType(linkedSource);
         system.CreateNote(linkedSource);
         return(true);
     }
     return(false);
 }
示例#3
0
 public override bool CreateNote(NoteSystem system, NoteSource source)
 {
     if (source.MatchesFileType(".wflnk"))
     {
         string         name         = "get name from .wflnk file;";
         FileNoteSource linkedSource = new FileNoteSource(system);
         linkedSource.SetName(name);
         List <NoteSource> linkedSources = new List <NoteSource>()
         {
             linkedSource
         };
         system.CreateNotes();
         return(true);
     }
     return(false);
 }
示例#4
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);
 }
 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);
 }
示例#6
0
 public abstract bool CreateNote(NoteSystem system, NoteSource source);