public int readFileVersion(string filename) { if (AccessCounter.ContainsKey(filename)) { FileAccessCounter counter = AccessCounter[filename]; counter.ReadVersionCounter++; } else { FileAccessCounter fileCounter = new FileAccessCounter(filename); fileCounter.ReadVersionCounter++; AccessCounter[filename] = fileCounter; } //ReadVersionCounter++; return State.readFileVersion(filename); }
public void write(File file) { if (AccessCounter.ContainsKey(file.FileName)) { FileAccessCounter counter = AccessCounter[file.FileName]; counter.WriteCounter++; } else { FileAccessCounter fileCounter = new FileAccessCounter(file.FileName); fileCounter.WriteCounter++; AccessCounter[file.FileName] = fileCounter; } State.write(file); //WriteCounter++; }
public void addAccesses(string server, string filename, FileAccessCounter accessCounter) { if (!FileAccesses.ContainsKey(filename)) { FileAccesses.Add(filename, new Dictionary<string, FileAccessCounter>()); } if (!FileAccesses[filename].ContainsKey(server)) { FileAccesses[filename].Add(server, new FileAccessCounter(filename)); } FileAccesses[filename][server] = accessCounter; }