如何解决如何触发按钮C#
这是条款表单代码: 当表格弹出时,有一个选择接受按钮; 我如何单击源代码中的接受 我只知道我需要使用触发器之类的东西,但是如何? 如果可以的话会很高兴
using System;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Honeygain.Presenters;
using Honeygain.Views.Controls;
using Honeygain.Views.Events;
namespace Honeygain.Views.Forms
{
// Token: 0x02000011 RID: 17
internal class TermsForm : BaseForm
{
// Token: 0x1400001F RID: 31
// (add) Token: 0x060000EB RID: 235 RVA: 0x00007DE0 File Offset: 0x00005FE0
// (remove) Token: 0x060000EC RID: 236 RVA: 0x00007E18 File Offset: 0x00006018
public event EventHandler<FormFailedEventArgs> TermsFailed;
// Token: 0x14000020 RID: 32
// (add) Token: 0x060000ED RID: 237 RVA: 0x00007E50 File Offset: 0x00006050
// (remove) Token: 0x060000EE RID: 238 RVA: 0x00007E88 File Offset: 0x00006088
public event EventHandler TermsRejected;
// Token: 0x060000EF RID: 239 RVA: 0x00002A43 File Offset: 0x00000C43
public TermsForm(IMainPresenter presenter)
{
this.InitializeComponent();
this._presenter = presenter;
}
// Token: 0x060000F0 RID: 240 RVA: 0x00002A58 File Offset: 0x00000C58
public void CloseTerms()
{
CancellationTokenSource actionCTS = this._actionCTS;
if (actionCTS != null)
{
actionCTS.Cancel();
}
this._actionCTS = null;
this._vid = null;
base.Hide();
}
// Token: 0x060000F1 RID: 241 RVA: 0x00007EC0 File Offset: 0x000060C0
public void ShowTerms(string text,string version,string vid)
{
if (!base.Visible)
{
CancellationTokenSource actionCTS = this._actionCTS;
if (actionCTS != null)
{
actionCTS.Cancel();
}
this._actionCTS = new CancellationTokenSource();
this.body.DocumentText = text;
this._version = version;
this._vid = vid;
base.ShowCenter();
}
}
// Token: 0x060000F2 RID: 242 RVA: 0x00002A7F File Offset: 0x00000C7F
private void OnFormVisibleChanged(object sender,EventArgs e)
{
if (!base.Visible)
{
this.Reject();
}
}
// Token: 0x060000F3 RID: 243 RVA: 0x00007F14 File Offset: 0x00006114
private void OnAcceptClick(object sender,EventArgs e)
{
TermsForm.<OnAcceptClick>d__14 <OnAcceptClick>d__;
<OnAcceptClick>d__.<>4__this = this;
<OnAcceptClick>d__.<>t__builder = AsyncVoidMethodBuilder.Create();
<OnAcceptClick>d__.<>1__state = -1;
<OnAcceptClick>d__.<>t__builder.Start<TermsForm.<OnAcceptClick>d__14>(ref <OnAcceptClick>d__);
}
// Token: 0x060000F4 RID: 244 RVA: 0x00002A8F File Offset: 0x00000C8F
private void Reject()
{
if (!string.IsNullOrEmpty(this._vid))
{
EventHandler termsRejected = this.TermsRejected;
if (termsRejected != null)
{
termsRejected(this,EventArgs.Empty);
}
}
this.CloseTerms();
}
// Token: 0x060000F5 RID: 245 RVA: 0x00007F4C File Offset: 0x0000614C
private Task Accept()
{
TermsForm.<Accept>d__16 <Accept>d__;
<Accept>d__.<>4__this = this;
<Accept>d__.<>t__builder = AsyncTaskMethodBuilder.Create();
<Accept>d__.<>1__state = -1;
<Accept>d__.<>t__builder.Start<TermsForm.<Accept>d__16>(ref <Accept>d__);
return <Accept>d__.<>t__builder.Task;
}
// Token: 0x060000F6 RID: 246 RVA: 0x00002ABB File Offset: 0x00000CBB
private void Prepare()
{
base.Enabled = false;
}
// Token: 0x060000F7 RID: 247 RVA: 0x00002AC4 File Offset: 0x00000CC4
private void Finish()
{
base.Enabled = true;
}
// Token: 0x060000F8 RID: 248 RVA: 0x00002ACD File Offset: 0x00000CCD
private void Fail(Exception exception)
{
EventHandler<FormFailedEventArgs> termsFailed = this.TermsFailed;
if (termsFailed != null)
{
termsFailed(this,new FormFailedEventArgs
{
Error = exception
});
}
this.CloseTerms();
}
// Token: 0x060000F9 RID: 249 RVA: 0x00002AF3 File Offset: 0x00000CF3
protected override void dispose(bool disposing)
{
if (disposing && this.components != null)
{
this.components.dispose();
}
base.dispose(disposing);
}
// Token: 0x060000FA RID: 250 RVA: 0x00007F90 File Offset: 0x00006190
private void InitializeComponent()
{
this.components = new Container();
ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(TermsForm));
this.panel = new TableLayoutPanel();
this.body = new Termsbrowser(this.components);
this.accept = new Button();
this.title = new Label();
this.panel.SuspendLayout();
base.SuspendLayout();
componentResourceManager.ApplyResources(this.panel,"panel");
this.panel.Controls.Add(this.body,1);
this.panel.Controls.Add(this.accept,2);
this.panel.Controls.Add(this.title,0);
this.panel.Name = "panel";
componentResourceManager.ApplyResources(this.body,"body");
this.body.IsWebbrowserContextMenuEnabled = false;
this.body.Name = "body";
this.body.ScriptErroRSSuppressed = true;
this.body.WebbrowserShortcutsEnabled = false;
componentResourceManager.ApplyResources(this.accept,"accept");
this.accept.BackColor = Color.FromArgb(11,152,222);
this.accept.ForeColor = Color.White;
this.accept.Name = "accept";
this.accept.UseVisualStyleBackColor = false;
this.accept.Click += this.OnAcceptClick;
componentResourceManager.ApplyResources(this.title,"title");
this.title.ForeColor = Color.FromArgb(14,65,88);
this.title.Name = "title";
componentResourceManager.ApplyResources(this,"$this");
base.Controls.Add(this.panel);
base.Name = "TermsForm";
base.VisibleChanged += this.OnFormVisibleChanged;
this.panel.ResumeLayout(false);
this.panel.Performlayout();
base.ResumeLayout(false);
base.Performlayout();
}
// Token: 0x0400006D RID: 109
private readonly IMainPresenter _presenter;
// Token: 0x0400006E RID: 110
private string _version;
// Token: 0x0400006F RID: 111
private string _vid;
// Token: 0x04000070 RID: 112
private CancellationTokenSource _actionCTS;
// Token: 0x04000073 RID: 115
private IContainer components;
// Token: 0x04000074 RID: 116
private TableLayoutPanel panel;
// Token: 0x04000075 RID: 117
private Termsbrowser body;
// Token: 0x04000076 RID: 118
private Button accept;
// Token: 0x04000077 RID: 119
private Label title;
}
}
这是条款表单代码: 当表格弹出时,有一个选择接受按钮; 我如何单击源代码中的接受 我只知道我需要使用触发器之类的东西,但是如何? 如果可以的话会很高兴
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。