Exemplo n.º 1
0
        private void ProgressReport(decimal current, StatusProgress status)
        {
            try
            {
                decimal total = status.total;
                decimal percent = 0;

                if (total != 0)
                    percent = current / total;
                decimal gap = status.end - status.start;

                if (gap != 0)
                {
                    decimal gapValue = gap * percent;

                    if ((int)(status.start + gapValue) >= 0 && (int)(status.start + gapValue) <= 100)
                        processing.SetValue = (int)(status.start + gapValue);
                }
            }
            catch (Exception ex)
            {
                Log.Unhandled(ex);
            }
        }
Exemplo n.º 2
0
        private void ReportProgressCustom(decimal current, StatusProgress status)
        {
            try
            {
                decimal total = status.total;
                decimal percent = 0;

                if (total != 0)
                    percent = current / total;
                decimal gap = status.end - status.start;

                if (gap != 0)
                {
                    decimal gapValue = gap * percent;

                    if (percent >= 0 && percent <= 100)
                        processing.SetValue = (int)(status.start + gapValue);

                    Log.Status(status.text + " (" + (current + 1) + " av " + total + ")");
                }
            }
            catch(Exception ex)
            {
                Log.Unhandled(ex);
            }
        }