Exemple #1
0
        private static void UpdateProgress()
        {
            ProgressBar.Invoke(new InvokeDelegate(SetProgressBarValue), (int)((double)Status.CurrentProgress * 10000 / Status.TotalProgress));

            if (Status.TotalProgress > 0)
            {
                ProgressLabel.Invoke(new InvokeDelegate(SetProgressLabel), string.Format("{0}/{1}", Status.CurrentProgress, Status.TotalProgress));
                PercentageLabel.Invoke(new InvokeDelegate(SetPercentageLabel), string.Format("{0:0.##}%", (double)Status.CurrentProgress * 100 / Status.TotalProgress));

                TimeUsageLabel.Invoke(new InvokeDelegate(SetTimeUsageLabel), "已用时间:" + TimeSpan.FromMilliseconds(Timer.ElapsedMilliseconds).ToString(@"hh\:mm\:ss\.fff"));

                var time = (double)Timer.ElapsedMilliseconds * (Status.TotalProgress - Status.CurrentProgress) / Status.CurrentProgress;
                if (time.HasValue())
                {
                    TimeEstimationLabel.Invoke(new InvokeDelegate(SetTimeEstimationLabel), "估计剩余时间:" + TimeSpan.FromMilliseconds(time).ToString(@"hh\:mm\:ss\.fff"));
                }
                else
                {
                    TimeEstimationLabel.Invoke(new InvokeDelegate(SetTimeEstimationLabel), "等待开始");
                }
            }
            else
            {
                StatusLabel.Invoke(new InvokeDelegate(SetStatusLabel), Status.CurrentStatus);
                ProgressLabel.Invoke(new InvokeDelegate(SetProgressLabel), "等待开始");
                PercentageLabel.Invoke(new InvokeDelegate(SetPercentageLabel), "等待开始");
                TimeUsageLabel.Invoke(new InvokeDelegate(SetTimeUsageLabel), "等待开始");
                TimeEstimationLabel.Invoke(new InvokeDelegate(SetTimeEstimationLabel), "等待开始");
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (CircleView != null)
            {
                CircleView.Dispose();
                CircleView = null;
            }

            if (PercentageLabel != null)
            {
                PercentageLabel.Dispose();
                PercentageLabel = null;
            }

            if (ProjectLabel != null)
            {
                ProjectLabel.Dispose();
                ProjectLabel = null;
            }

            if (TotalTimeLabel != null)
            {
                TotalTimeLabel.Dispose();
                TotalTimeLabel = null;
            }
        }
Exemple #3
0
        public static void RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            StatusLabel.Invoke(new InvokeDelegate(SetStatusLabel), "等待开始");
            ProgressLabel.Invoke(new InvokeDelegate(SetProgressLabel), "等待开始");
            PercentageLabel.Invoke(new InvokeDelegate(SetPercentageLabel), "等待开始");
            TimeUsageLabel.Invoke(new InvokeDelegate(SetTimeUsageLabel), "等待开始");
            TimeEstimationLabel.Invoke(new InvokeDelegate(SetTimeEstimationLabel), "等待开始");

            ProgressBar.Invoke(new InvokeDelegate(SetProgressBarValue), 0);
            //ProgressBar.Invoke(new InvokeDelegate(SetProgressBarMaximum), 100);

            //Console.WriteLine("Worker Reset");
            WorkerInBusy.Set();
        }
        void ReleaseDesignerOutlets()
        {
            if (PercentageLabel != null)
            {
                PercentageLabel.Dispose();
                PercentageLabel = null;
            }

            if (WeightLabel != null)
            {
                WeightLabel.Dispose();
                WeightLabel = null;
            }
        }
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            FadeView.FadeRight = true;

            this.DelayBind(() =>
            {
                var colorConverter      = new MvxRGBValueConverter();
                var durationCombiner    = new DurationValueCombiner();
                var visibilityConverter = new MvxVisibilityValueConverter();
                var bindingSet          = this.CreateBindingSet <ReportsLegendViewCell, ChartSegment>();

                ProjectLabel.SetKerning(-0.2);
                ClientLabel.SetKerning(-0.2);
                TotalTimeLabel.SetKerning(-0.2);
                PercentageLabel.SetKerning(-0.2);

                //Text
                bindingSet.Bind(ProjectLabel).To(vm => vm.ProjectName);
                bindingSet.Bind(ClientLabel).To(vm => vm.ClientName);
                bindingSet.Bind(PercentageLabel)
                .For(v => v.Text)
                .ByCombining("Format", "'{0:0.00}%'", nameof(ChartSegment.Percentage));

                bindingSet.Bind(TotalTimeLabel)
                .ByCombining(durationCombiner,
                             vm => vm.TrackedTime,
                             vm => vm.DurationFormat);

                bindingSet.Bind(ClientLabel)
                .For(v => v.BindVisibility())
                .To(vm => vm.HasClient)
                .WithConversion(visibilityConverter);

                // Color
                bindingSet.Bind(ProjectLabel)
                .For(v => v.TextColor)
                .To(vm => vm.Color)
                .WithConversion(colorConverter);

                bindingSet.Bind(CircleView)
                .For(v => v.BackgroundColor)
                .To(vm => vm.Color)
                .WithConversion(colorConverter);

                bindingSet.Apply();
            });
        }
 void ReleaseDesignerOutlets()
 {
     if (PercentageLabel != null)
     {
         PercentageLabel.Dispose();
         PercentageLabel = null;
     }
     if (PercentageStepper != null)
     {
         PercentageStepper.Dispose();
         PercentageStepper = null;
     }
     if (WeightTextField != null)
     {
         WeightTextField.Dispose();
         WeightTextField = null;
     }
 }
Exemple #7
0
        void ReleaseDesignerOutlets()
        {
            if (ChunkSizeTextField != null)
            {
                ChunkSizeTextField.Dispose();
                ChunkSizeTextField = null;
            }

            if (PercentageLabel != null)
            {
                PercentageLabel.Dispose();
                PercentageLabel = null;
            }

            if (ProgressBarOutlet != null)
            {
                ProgressBarOutlet.Dispose();
                ProgressBarOutlet = null;
            }
        }
Exemple #8
0
        protected override void UpdateView()
        {
            ProjectLabel.SetKerning(-0.2);
            ClientLabel.SetKerning(-0.2);
            TotalTimeLabel.SetKerning(-0.2);
            PercentageLabel.SetKerning(-0.2);

            //Text
            ProjectLabel.Text    = Item.ProjectName;
            ClientLabel.Text     = Item.ClientName;
            PercentageLabel.Text = $"{Item.Percentage:F2}%";
            TotalTimeLabel.Text  = Item.TrackedTime.ToFormattedString(Item.DurationFormat);

            ClientLabel.Hidden = !Item.HasClient;

            // Color
            var color = new Color(Item.Color).ToNativeColor();

            ProjectLabel.TextColor     = color;
            CircleView.BackgroundColor = color;
        }
Exemple #9
0
        void ReleaseDesignerOutlets()
        {
            if (CalculateSplit != null)
            {
                CalculateSplit.Dispose();
                CalculateSplit = null;
            }

            if (GrovealeImage != null)
            {
                GrovealeImage.Dispose();
                GrovealeImage = null;
            }

            if (PercentageLabel != null)
            {
                PercentageLabel.Dispose();
                PercentageLabel = null;
            }

            if (SaveSplit != null)
            {
                SaveSplit.Dispose();
                SaveSplit = null;
            }

            if (SplitNumber != null)
            {
                SplitNumber.Dispose();
                SplitNumber = null;
            }

            if (TipLabel != null)
            {
                TipLabel.Dispose();
                TipLabel = null;
            }

            if (TipPercentage != null)
            {
                TipPercentage.Dispose();
                TipPercentage = null;
            }

            if (TipSwitch != null)
            {
                TipSwitch.Dispose();
                TipSwitch = null;
            }

            if (TotalAmount != null)
            {
                TotalAmount.Dispose();
                TotalAmount = null;
            }

            if (TotalSplitAmount != null)
            {
                TotalSplitAmount.Dispose();
                TotalSplitAmount = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (AmountLabel != null)
            {
                AmountLabel.Dispose();
                AmountLabel = null;
            }

            if (AmountText != null)
            {
                AmountText.Dispose();
                AmountText = null;
            }

            if (ExcellentLabel != null)
            {
                ExcellentLabel.Dispose();
                ExcellentLabel = null;
            }

            if (PercentageLabel != null)
            {
                PercentageLabel.Dispose();
                PercentageLabel = null;
            }

            if (PoorLabel != null)
            {
                PoorLabel.Dispose();
                PoorLabel = null;
            }

            if (RestaurantImageView != null)
            {
                RestaurantImageView.Dispose();
                RestaurantImageView = null;
            }

            if (ServiceLabel != null)
            {
                ServiceLabel.Dispose();
                ServiceLabel = null;
            }

            if (ServiceSlider != null)
            {
                ServiceSlider.Dispose();
                ServiceSlider = null;
            }

            if (TaxAmountText != null)
            {
                TaxAmountText.Dispose();
                TaxAmountText = null;
            }

            if (TaxLabel != null)
            {
                TaxLabel.Dispose();
                TaxLabel = null;
            }

            if (TaxPercentageText != null)
            {
                TaxPercentageText.Dispose();
                TaxPercentageText = null;
            }

            if (TaxSwitch != null)
            {
                TaxSwitch.Dispose();
                TaxSwitch = null;
            }

            if (TipAmountText != null)
            {
                TipAmountText.Dispose();
                TipAmountText = null;
            }

            if (TipCalcLabel != null)
            {
                TipCalcLabel.Dispose();
                TipCalcLabel = null;
            }

            if (TipLabel != null)
            {
                TipLabel.Dispose();
                TipLabel = null;
            }

            if (TipPercentageText != null)
            {
                TipPercentageText.Dispose();
                TipPercentageText = null;
            }

            if (TotalLabel != null)
            {
                TotalLabel.Dispose();
                TotalLabel = null;
            }

            if (TotalText != null)
            {
                TotalText.Dispose();
                TotalText = null;
            }
        }