Exemplo n.º 1
0
        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];
        }
Exemplo n.º 2
0
        private void Uploader_UploadProgress(object sender, UploaderProgressEventArgs e)
        {
            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.UploadLatestScreenshot.UploadProgressChanged [{0}]", System.Threading.Thread.CurrentThread.Name));

                    UploadAnimationIndex = i;
                    pnUpload.BackgroundImage = pnUpload.isMouseOver() ? ilUploadAnimationWhite.Images[UploadAnimationIndex] : ilUploadAnimationBlack.Images[UploadAnimationIndex];
                }
            }
        }
Exemplo n.º 3
0
        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];
                }
            }
        }
Exemplo n.º 4
0
 protected void OnUploadProgress(UploaderProgressEventArgs e)
 {
     _context.Post(o => UploadProgress(this, e), null);
 }