Beispiel #1
0
        public override void SetContent()
        {
            base.SetContent();

            var gridRow = this.RowInfo as GridViewGroupRowInfo;

            if (gridRow == null)
            {
                return;
            }

            int  remainingFileCount = 0;
            long copiedBytes        = 0;
            long totalBytes         = 0;
            bool hasErrors          = false;

            foreach (var dataRow in RadGridViewHelper.GetChildDataRows(gridRow))
            {
                remainingFileCount = Math.Max(remainingFileCount, dataRow.Field <int>("remainingFileCount"));
                copiedBytes       += dataRow.Field <long>("copiedBytes");
                totalBytes        += dataRow.Field <long>("totalBytes");
                hasErrors         |= dataRow.Field <bool>("hasErrors");
            }

            _headerElement.Text     = gridRow.HeaderText;
            _hasErrorsElement.Image = hasErrors ? Resources.ExclamationRed : Resources.CheckedGreen;

            _progressElement.Value1 = totalBytes <= 0 ? 0 : Convert.ToInt32((double)copiedBytes / (double)totalBytes * 100);
            _progressElement.Text   = string.Format("{0} remaining ({1}/{2})", remainingFileCount, ByteSizeFriendlyName.Build(copiedBytes), ByteSizeFriendlyName.Build(totalBytes));
            _progressElement.IndicatorElement1.BackColor = (hasErrors || _progressElement.Value1 < 100) ? _defaultProgressBarColor : Color.LimeGreen;

            this.Text = string.Empty;
        }