private void MenReplaceBody_Click(object sender, EventArgs e)
 {
     using (CodeForm codeForm = new CodeForm(OwnerDefinition))
     {
         if (codeForm.ShowDialog(this) == DialogResult.OK)
         {
             CecilHelper.CloneMethodBody(codeForm.MethodDefinition, OwnerDefinition);
             if (BodyReplaced != null)
             {
                 BodyReplaced(this, EventArgs.Empty);
             }
         }
     }
 }
        private void TSMI_FindSubject_Click(object sender, EventArgs e)
        {
            CodeForm codeForm = new CodeForm("Find");

            if (codeForm.ShowDialog(this) != System.Windows.Forms.DialogResult.OK)
            {
                if (codeForm.SubjectDTO != null)
                {
                    dtgView.DataSource = new List <SubjectDTO>()
                    {
                        codeForm.SubjectDTO
                    };
                }
            }
        }
 private void MenReplaceBody_Click(object sender, EventArgs e)
 {
     using (var codeForm = new CodeForm(OwnerDefinition))
     {
         if (codeForm.ShowDialog(this) == DialogResult.OK)
         {
             try
             {
                 CecilHelper.CloneMethodBody(codeForm.MethodDefinition, OwnerDefinition);
                 if (BodyReplaced != null)
                 {
                     BodyReplaced(this, EventArgs.Empty);
                 }
             }
             catch (ArgumentException ex)
             {
                 MessageBox.Show(ex.Message);
             }
         }
     }
 }