private void CompactionProgress(int value)
 {
     if (this.prgCompact.InvokeRequired)
     {
         Delegate d = new OperationProgressDelegate(CompactionProgress);
         this.Invoke(d, new Object[] { value });
     }
     else
     {
         this.prgCompact.Value = value;
         if (this.prgCompact.Value == this.prgCompact.Maximum)
         {
             this._compacter = null;
             this.ShowDatabaseInformation();
             MessageBox.Show("Compaction Completed successfully!");
         }
     }
 }
 private void CompactionError(Exception ex)
 {
     if (this.InvokeRequired)
     {
         Delegate d = new OperationErrorDelegate(CompactionError);
         this.Invoke(d, new Object[] { ex });
     }
     else
     {
         MessageBox.Show("An error occurred while trying to compact the Store:\n" + ex.Message);
         this.ShowDatabaseInformation();
         this._compacter = null;
     }
 }
        private void btnCompactStore_Click(object sender, EventArgs e)
        {
            if (this._compacter == null)
            {
                if (this._connection.IsDotNetRDFStore())
                {
                    this._compacter = new StoreCompacter(this._connection, this.chkCompactFull.Checked);

                    if (MessageBox.Show("Are you sure you wish to Compact this dotNetRDF Store?", "Confirm Store Compaction", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        this.prgCompact.Value = 0;
                        this.prgCompact.Maximum = this._compacter.OperationsRequired();
                        this._compacter.Error += this.CompactionError;
                        this._compacter.Progress += this.CompactionProgress;

                        this.btnCompactStore.Enabled = false;
                        this._compacter.Compact();
                    }
                }
            }
        }