public static Form Create(ClassEditParams p) { var a = Assembly.GetEntryAssembly(); var t = a.GetType(a.GetName().Name + ".frmClassEdit"); return((Form)Activator.CreateInstance(t, new object[] { p })); }
public static MethodDefinition Run(ClassEditParams p) { var f = Create(p); f.ShowDialog(); var t = f.GetType(); var r = t.GetProperty("SelectedMethod"); return (MethodDefinition) r.GetValue(f, null); }
private void InitForm(ClassEditParams p) { try { //this.SuspendLayout(); Host = p.Host; Rows = p.Rows; SourceDir = SimplePath.GetFullPath(p.SourceDir); ShowStaticOnly = p.ShowStaticOnly; ShowSelectButton = p.ShowSelectButton; tbSelect.Visible = ShowSelectButton; tbSave.Visible = !ShowSelectButton; //dgBody.Visible = false; //dgResource.Visible = false; //panelResource.Visible = false; dgBody.Dock = DockStyle.Fill; dgResource.Dock = DockStyle.Fill; panelResource.Dock = DockStyle.Fill; txtResource.Dock = DockStyle.Fill; //pbResource.Dock = DockStyle.Fill; pbResource.Left = 0; pbResource.Top = 0; lvResource.Dock = DockStyle.Fill; hbResource.Dock = DockStyle.Fill; rtbText.Font = Config.ClassEditorRichTextBoxFont; rtbILSpyText.Font = Config.ClassEditorRichTextBoxFont; LogHandler = new ClassEditLogHandler(this); BodyGridHandler = new ClassEditBodyGridHandler(this); VariableGridHandler = new ClassEditVariableGridHandler(this); ResourceHandler = new ClassEditResourceHandler(this); SearchHandler = new ClassEditSearchHandler(this); ReflectorHandler = new ClassEditReflectorHandler(this); ILSpyHandler = new ClassEditILSpyHandler(this); BookmarkHandler = new ClassEditBookmarkHandler(this); TreeViewHandler = new ClassEditTreeViewHandler(this); BinaryViewHandler = new ClassEditBinaryViewHandler(this); TextViewHandler = new ClassEditTextViewHandler(this); TreeViewHandler.ObjectType = p.ObjectType; } catch { throw; } finally { //this.ResumeLayout(); } }
public static MethodDefinition Run(ClassEditParams p) { var f = Create(p); f.ShowDialog(); var t = f.GetType(); var r = t.GetProperty("SelectedMethod"); return((MethodDefinition)r.GetValue(f, null)); }
public frmClassEdit(ClassEditParams p) { InitializeComponent(); InitForm(p); }
public static Form Create(ClassEditParams p) { var a = Assembly.GetEntryAssembly(); var t = a.GetType(a.GetName().Name + ".frmClassEdit"); return (Form)Activator.CreateInstance(t, new object[] { p }); }
private void btnSelectMethod_Click(object sender, EventArgs e) { var type = (SAE.de4dot.de4dotOptions.StringDecrypterTypes)cboStringDecrypter.SelectedItem; bool showStaticOnly = (type == de4dotOptions.StringDecrypterTypes.Default || type == de4dotOptions.StringDecrypterTypes.Static); var p = new ClassEditParams() { Host = _host, Rows = _rows, SourceDir = _sourceDir, ObjectType = ObjectTypes.Method, ShowStaticOnly = showStaticOnly, ShowSelectButton = true }; var selectedMethod = ClassEditUtils.Run(p); if (selectedMethod != null) { txtStringDecrypterMethod.Text = TokenUtils.GetFullMetadataTokenString(selectedMethod.MetadataToken); } else { txtStringDecrypterMethod.Text = String.Empty; } }