Пример #1
0
        internal void RefreshProgress(
            Client.BaseCommands.UpdateProgress progress, UpdateProgressData updateProgressData)
        {
            mUpdateProgress = progress;

            mGuiClient.Progress.ProgressHeader = updateProgressData.Details;

            mGuiClient.Progress.TotalProgressMessage = updateProgressData.Status;
            mGuiClient.Progress.TotalProgressPercent = updateProgressData.ProgressValue / 100;
        }
Пример #2
0
        private IEnumerator ProgressBar(UpdateProgressData d)
        {
            if (d.Image == null)
            {
                yield return(null);
            }

            float originPercent = d.Image.fillAmount;
            float elapsed       = 0;

            while (elapsed < Settings.BarProgressSpeed)
            {
                elapsed           += Time.deltaTime;
                d.Image.fillAmount = Mathf.Lerp(originPercent, d.TargetPercent, elapsed / Settings.BarProgressSpeed);
                yield return(new WaitForEndOfFrame());
            }
            d.Image.fillAmount = d.TargetPercent;
        }
        public Kernel32.CopyFileCallbackAction CopyFileCallback(
            string source, string destination, object state,
            long totalFileSize, long totalBytesTransferred)
        {
            int atomCount = (int)(totalBytesTransferred / FileRoutines.FILESIZE_NOTIFY_ATOM);

            if (atomCount != _transferredAtomCount)
            {
                _transferredAtomCount = atomCount;
                UpdateProgressData data = new UpdateProgressData(totalFileSize, totalBytesTransferred);
                _task.FireTaskProgress(ProgressEventType.Progress, source, data);
            }

            while (_fileTaskWaitEvent.WaitOne(10))
            {
                Application.DoEvents();
            }

            return(CanContinue ?
                   Kernel32.CopyFileCallbackAction.Continue :
                   Kernel32.CopyFileCallbackAction.Cancel);
        }
Пример #4
0
 void IUpdateProgress.RefreshProgress(
     Codice.Client.BaseCommands.UpdateProgress updateProgress,
     UpdateProgressData updateProgressData)
 {
     mUpdateProgress.RefreshProgress(updateProgress, updateProgressData);
 }