public NodeReader(string path, IPipe output, WorkMonitor Monitor) : base(null, output /*,null*/) { if (!File.Exists(path)) { throw new Exception("File does not exists: " + path); } reader = new FileStream(path, FileMode.Open); var fi = new FileInfo(path); Monitor.TotalWork = (int)fi.Length; this.Monitor = Monitor; }
public NodeWriter(string path, long size, IPipe input, WorkMonitor Monitor) : base(input, null) { //if (!File.Exists(path)) throw new Exception("File does not exists: " + path); this.size = size; if (File.Exists(path)) { string temp = Path.GetDirectoryName(path) + @"\" + Path.GetFileNameWithoutExtension(path) + "({0})" + Path.GetExtension(path); int i = 1; do { path = String.Format(temp, i); i++; } while (File.Exists(path)); } writer = new FileStream(path, FileMode.Create); Monitor.TotalWork = (int)size; this.Monitor = Monitor; }
public ChainManager() { _tokenSource = new CancellationTokenSource(); Monitor = new WorkMonitor(); token = new NodeToken(); }