internal void UploadProgress(object sender, UploaderProgressEventArgs e) { if (this.InvokeRequired) { Trace.WriteLine("Self invoking...", string.Format("PeekPreview.UploadProgress [{0}]", System.Threading.Thread.CurrentThread.Name)); this.BeginInvoke(new MethodInvoker(() => UploadProgress(sender, e))); return; } if (e.Screenshot != this.CurrentScreenshot) { return; } var i = ((int)e.Percent) / (ilUploadAnimationBlack.Images.Count - 1); if (i != UploadAnimationIndex) { if (i >= 0 && i < ilUploadAnimationBlack.Images.Count) { Trace.WriteLine(string.Format("Uploading: '{0}'", i), string.Format("PeekPreview.UploadProgress [{0}]", System.Threading.Thread.CurrentThread.Name)); UploadAnimationIndex = i; pnUpload.BackgroundImage = pnUpload.isMouseOver() ? ilUploadAnimationWhite.Images[UploadAnimationIndex] : ilUploadAnimationBlack.Images[UploadAnimationIndex]; } } }
internal void UploadStarted(object sender, UploaderProgressEventArgs e) { if (this.InvokeRequired) { Trace.WriteLine("Self invoking...", string.Format("PeekPreview.UploadStarted [{0}]", System.Threading.Thread.CurrentThread.Name)); this.BeginInvoke(new MethodInvoker(() => UploadStarted(sender, e))); return; } if (e.Screenshot != this.CurrentScreenshot) { return; } UploadAnimationIndex = 0; pnUpload.BackgroundImage = pnUpload.isMouseOver() ? ilUploadAnimationWhite.Images[UploadAnimationIndex] : ilUploadAnimationBlack.Images[UploadAnimationIndex]; }