internal static void WriteFileToDisk(IFile file)
        {
            Verify.ArgumentNotNull(file, "file");

            FileSystemFileBase baseFile = file as FileSystemFileBase;

            Verify.ArgumentCondition(baseFile != null, "file", "The type '{0}' does not inherit the class '{1}'"
                                     .FormatWith(file.GetType(), typeof(FileSystemFileBase)));

            if (Transaction.Current == null)
            {
                LogNoTransaction();

                baseFile.CommitChanges();
            }
            else
            {
                Transaction.Current.EnlistVolatile(new WriteToDiskEnlistment(file, baseFile), EnlistmentOptions.None);
            }
        }
Exemplo n.º 2
0
        public static void Subscribe(FileSystemFileBase file, OnFileChangedDelegate handler)
        {
            Verify.ArgumentNotNull(file, "file");

            Subscribe(file.SystemPath, handler);
        }
Exemplo n.º 3
0
        public static void Subscribe(FileSystemFileBase file, OnFileChangedDelegate handler)
        {
            Verify.ArgumentNotNull(file, "file");

            Subscribe(file.SystemPath, handler);
        }
 public DeleteEnlistment(FileSystemFileBase baseFile)
 {
     this.baseFile = baseFile;
 }
 public WriteToDiskEnlistment(IFile file, FileSystemFileBase baseFile)
 {
     this.file     = file;
     this.baseFile = baseFile;
 }
 public DeleteEnlistment(FileSystemFileBase baseFile)
 {
     this.baseFile = baseFile;
 }
 public WriteToDiskEnlistment(IFile file, FileSystemFileBase baseFile)
 {
     this.file = file;
     this.baseFile = baseFile;
 }