public virtual void InitRichText(object cecilObject)
        {
            rtbText.Clear();

            object o = GetDecompileObject(cecilObject);

            if (o == null)
            {
                return;
            }

            SimpleWaitCursor wc = new SimpleWaitCursor();

            try
            {
                highlightText = null;
                rtbText.SuspendLayout();
                DecompileObject(o);
            }
            catch (Exception ex)
            {
                while (ex.InnerException != null)
                {
                    ex = ex.InnerException;
                }
                rtbText.Rtf = GetRtf(ex.Message, ex.StackTrace);
            }
            finally
            {
                rtbText.ResumeLayout();
                wc.Dispose();
            }
        }
 public virtual void Init()
 {
     if (!IsReady)
     {
         SimpleWaitCursor wc = new SimpleWaitCursor();
         try
         {
             _form.SetStatusText(String.Format("Loading {0} ...", _name));
             Initializing = true;
             InitControls();
             InitAssemblyPath();
         }
         catch
         {
             _form.TabControl.SelectedTab = _form.DetailsTabPage;
             throw;
         }
         finally
         {
             wc.Dispose();
             Initializing = false;
             _form.SetStatusText(null);
         }
     }
 }
        private void AddFiles(string path)
        {
            int saveCurrentRowIndex = -1;

            if (treeView1.SelectedNode != null &&
                path == treeView1.SelectedNode.FullPath &&
                this.dgvData.CurrentRow != null)
            {
                saveCurrentRowIndex = dgvData.CurrentRow.Index;
            }

            SimpleWaitCursor wc = new SimpleWaitCursor();

            try
            {
                _form.AssemblyDataGridBindingSource.DataSource = null;
                dtFiles.Clear();
                AddFiles(path, "*.dll");
                if (!escPressed)
                {
                    AddFiles(path, "*.exe");
                }
                if (!escPressed)
                {
                    AddFiles(path, "*.netmodule");
                }
                if (!escPressed)
                {
                    AddFiles(path, "*.il");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (String.IsNullOrEmpty(dtFiles.DefaultView.Sort))
                {
                    dtFiles.DefaultView.Sort = dtFiles.Columns[0].ColumnName;
                }
                _form.AssemblyDataGridBindingSource.DataSource = dtFiles;
                wc.Dispose();
            }

            if (saveCurrentRowIndex >= 0)
            {
                SetCurrentRow(saveCurrentRowIndex);
            }
        }