public void DeleteOperation(OpenFileOperation oop) { if (operationTable.Contains(oop.path)) { FileOperationTableEntry entry = (FileOperationTableEntry)operationTable[oop.path]; entry.open = null; if (entry.write == null) { lock (operationTable) { operationTable.Remove(oop.path); } } } }
public FileOperation.Action Update(OpenFileOperation fop) { if (open == null) { open = fop; Console.WriteLine("here1"); //return open.DecideAction(); } else { if (fop.date - open.date > new TimeSpan(0, 0, OpenFileOperation.suppressOpenInterval)) { open.date = fop.date; // return open.DecideAction(); } } return(open.DecideAction()); }
public FileOperation.Action HandleOpenOperation(string filePath) { OpenFileOperation oop = new OpenFileOperation(filePath, System.DateTime.UtcNow); if (!operationTable.Contains(filePath)) { lock (operationTable) { operationTable.Add(filePath, new FileOperationTableEntry(oop)); } Logger.GetInstance().Debug("HandleOpenOperation added file: " + filePath); return(oop.DecideAction()); } else { return(((FileOperationTableEntry)operationTable[filePath]).Update(oop)); } }
public FileOperation.Action Update(OpenFileOperation fop) { if (open == null) { open = fop; Console.WriteLine("here1"); //return open.DecideAction(); } else { if (fop.date - open.date > new TimeSpan(0, 0, OpenFileOperation.suppressOpenInterval)) { open.date = fop.date; // return open.DecideAction(); } } return open.DecideAction(); }
public FileOperationTableEntry(OpenFileOperation fop) { this.open = fop; }
public FileOperation.Action HandleOpenOperation(string filePath) { OpenFileOperation oop = new OpenFileOperation(filePath, System.DateTime.UtcNow); if (!operationTable.Contains(filePath)) { lock (operationTable) { operationTable.Add(filePath, new FileOperationTableEntry(oop)); } Logger.GetInstance().Debug("HandleOpenOperation added file: " + filePath); return oop.DecideAction(); } else { return ((FileOperationTableEntry)operationTable[filePath]).Update(oop); } }