Beispiel #1
0
 public ReadOnlyFile(MemoryStream initialContent, FileInfo path, UpToDateFile.BackEnd backEnd)
 {
     m_upToDateFile              = new UpToDateFile(initialContent, path, s => { }, backEnd);
     m_backEnd                   = backEnd;
     m_upToDateFile.FileChanged += () => FileModifiedExternally.Execute();
     m_upToDateFile.FileDeleted += () => FileDeletedExternally.Execute();
 }
Beispiel #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="initialContent">Represents the current contents of the file. Reference is not held. A copy is made.</param>
 /// <param name="path"></param>
 /// <param name="saveTo"></param>
 protected SaveableFile(MemoryStream initialContent, FileInfo path, Action <Stream> saveTo, UpToDateFile.BackEnd backEnd)
 {
     m_upToDateFile              = new UpToDateFile(initialContent, path, saveTo, backEnd);
     m_upToDateFile.FileChanged += () => FileModifiedExternally.Execute();
     m_upToDateFile.FileDeleted += () => FileDeletedExternally.Execute();
     m_saveTo  = saveTo;
     m_backEnd = backEnd;
 }
Beispiel #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="initialContent">Represents the current contents of the file. Reference is not held. A copy is made.</param>
 /// <param name="path"></param>
 /// <param name="saveTo"></param>
 /// <param name="changed"></param>
 /// <param name="saved"></param>
 public SaveableFileExternalChangedSource(MemoryStream initialContent, FileInfo path, Action <Stream> saveTo, Func <bool> changed, Action saved, UpToDateFile.BackEnd backEnd)
     : base(initialContent, path, saveTo, backEnd)
 {
     m_changed     = changed;
     m_saved       = saved;
     m_lastChanged = false;
 }
Beispiel #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="initialContent">Represents the current contents of the file. Reference is not held. A copy is made.</param>
 /// <param name="path"></param>
 /// <param name="saveTo"></param>
 public SaveableFileNotUndoable(MemoryStream initialContent, FileInfo path, Action <Stream> saveTo, UpToDateFile.BackEnd backEnd)
     : base(initialContent, path, saveTo, backEnd)
 {
 }
Beispiel #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="initialContent">Represents the current contents of the file. Reference is not held. A copy is made.</param>
 /// <param name="path"></param>
 /// <param name="saveTo"></param>
 public SaveableFileUndoable(MemoryStream initialContent, FileInfo path, Action <Stream> saveTo, UpToDateFile.BackEnd backEnd)
     : base(initialContent, path, saveTo, backEnd)
 {
     FileModifiedExternally += () => m_undoQueue.NeverSaved();
     FileDeletedExternally  += () => m_undoQueue.NeverSaved();
     m_undoQueue             = new UndoQueue(path.Name);
 }