Esempio n. 1
0
        public void Preview(IWin32Window owner = null)
        {
            try
            {
                dgInfo.Rows.Clear();
                _mapRows.Clear();
                this.Show(owner);

                if (_task == null)
                {
                    return;
                }

                if (!_task.Initialized)
                {
                    _task.Init();
                }

                _task.OnCopyStatusChanged += OnCopyStatusChanged;
                foreach (var map in _task.Mapping)
                {
                    DataGridViewRow row = dgInfo.Rows[dgInfo.Rows.Add()];
                    row.Cells["Path"].Value  = map.Key;
                    row.Cells["Files"].Value = map.Value.FileList.Count();

                    _mapRows[map.Value] = row.Index;
                }
                btnRun.Enabled = true;
            }
            catch (Exception ex)
            {
                ErrorHandler.Handle(ex, "Error initalizing task");
            }
        }