Beispiel #1
0
 private void dgv_ErrorsViewer_SelectionChanged(object sender, EventArgs e)
 {
     JustRunEventByUser(() =>
     {
         var currentRow = DynamicDgv.GetCurrentRow();
         if (currentRow != null)
         {
             pictureBox_viewer.Image = currentRow.Snapshot.Value ?? Properties.Resources._null;
         }
     });
 }
Beispiel #2
0
        private void timer_Tick(object sender, EventArgs e)
        {
            SqlCompactEditionManager.SetConnectionString(txtCacheFilePath.Text);

            var newErrors = SqlCompactEditionManager.GetErrors().ToList();

            //
            // Update old errors
            foreach (var item in newErrors.Union(_errors))
            {
                DynamicDgv.UpdateRow(item);
            }
            //
            // Add new errors
            foreach (var item in newErrors.Except(_errors))
            {
                _errors.Add(item);

                DynamicDgv.AddRow(item);
            }
            //
            // Remove sent errors in old list and data grid view
            foreach (var item in _errors.Except(newErrors))
            {
                DynamicDgv.RemoveRow(item);
            }

            _errors = newErrors;

            refreshAlert.Clear();

            SetCacheSizeViewer();

            CountDatabaseRecords();

            CountCacheRecords();

            if (DynamicDgv.RowCount > 0 && DynamicDgv.SelectedRows[0].Index == 0)
            {
                dgv_ErrorsViewer_SelectionChanged(sender, e);
            }
        }