private void OnIOFinished(IOEventArgs e) { if (IOFinished != null) { IOFinished(this, e); } }
public void IOEventHandler(object sender, IOEventArgs e) { double percent; lock (this) { totalBytes += (long)e.Count; percent = Math.Max(0.0, Math.Min(100.0, ((double)totalBytes * 100.0) / (double)maxBytes)); } callback(sender, new ProgressEventArgs(percent)); }
private void siphonStream_IOFinished(object sender, IOEventArgs e) { totalBytes += (long)e.Count; Progress = Math.Max(0, Math.Min(100, (int)((totalBytes * 100) / siphonStream.Length))); }