📄 mobileemailbindform.cs
字号:
namespace Imps.Client.Pc.Options
{
using Imps.Client.Core;
using Imps.Client.Pc;
using Imps.Client.Pc.BizControls;
using Imps.Client.Pc.Controls;
using Imps.Client.Resource;
using Imps.Client.Utils;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Net;
using System.Windows.Forms;
public class MobileEmailBindForm : XIMDialog
{
private IFrameworkWindow _iFrameworkWindow;
private IContainer components;
private Label label1;
private Label label3;
private Label label4;
private Label label5;
private Label label8;
private Panel panel1;
private PictureBox pictureBox1;
private XButton xbCancel;
private XButton xbOK;
public MobileEmailBindForm()
{
this.InitializeComponent();
base.Text = AppDictionary.CurrentClientName;
this.pictureBox1.Image = ImpsIcons.InfoImage;
}
public MobileEmailBindForm(IFrameworkWindow frameworkWnd) : this()
{
this._iFrameworkWindow = frameworkWnd;
this._user.MobileMailInfo.OperateReturn += new EventHandler<MobileEmailOperateEventArgs>(this, (IntPtr) this.MobileMailInfo_OperateReturn);
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
ComponentResourceManager manager = new ComponentResourceManager(typeof(MobileEmailBindForm));
this.label1 = new Label();
this.label3 = new Label();
this.label4 = new Label();
this.label5 = new Label();
this.xbCancel = new XButton();
this.xbOK = new XButton();
this.label8 = new Label();
this.pictureBox1 = new PictureBox();
this.panel1 = new Panel();
this.pictureBox1.BeginInit();
this.panel1.SuspendLayout();
base.SuspendLayout();
this.label1.set_AutoSize(true);
this.label1.BackColor = Color.Transparent;
this.label1.Font = new Font("Microsoft Sans Serif", 8.25f);
this.label1.Location = new System.Drawing.Point(90, 12);
this.label1.Name = "label1";
this.label1.Size = new Size(0xf7, 13);
this.label1.TabIndex = 0;
this.label1.Text = "您的飞信尚未与手机邮箱进行绑定,无法通过";
this.label3.set_AutoSize(true);
this.label3.BackColor = Color.Transparent;
this.label3.Font = new Font("Microsoft Sans Serif", 8.25f);
this.label3.Location = new System.Drawing.Point(90, 0x23);
this.label3.Name = "label3";
this.label3.Size = new Size(0xe7, 13);
this.label3.TabIndex = 2;
this.label3.Text = "飞信直接访问您的手机邮箱!点击“下一步”";
this.label4.set_AutoSize(true);
this.label4.BackColor = Color.Transparent;
this.label4.Font = new Font("Microsoft Sans Serif", 8.25f);
this.label4.Location = new System.Drawing.Point(90, 0x3a);
this.label4.Name = "label4";
this.label4.Size = new Size(0x73, 13);
this.label4.TabIndex = 3;
this.label4.Text = "绑定您的手机邮箱。";
this.label5.set_AutoSize(true);
this.label5.BackColor = Color.Transparent;
this.label5.Font = new Font("Microsoft Sans Serif", 8.25f);
this.label5.Location = new System.Drawing.Point(0x71, 0x74);
this.label5.Name = "label5";
this.label5.Size = new Size(0, 13);
this.label5.TabIndex = 4;
this.xbCancel.AutoArrangementX = true;
this.xbCancel.AutoSizeToImage = false;
this.xbCancel.BackColor = Color.Transparent;
this.xbCancel.BackgroundImageDisable = null;
this.xbCancel.BackgroundImageDown = null;
this.xbCancel.BackgroundImageHover = null;
this.xbCancel.ChangeSkin = true;
this.xbCancel.DialogResult = DialogResult.Cancel;
this.xbCancel.Location = new System.Drawing.Point(0x13a, 180);
this.xbCancel.Name = "xbCancel";
this.xbCancel.Size = new Size(0x4b, 0x17);
this.xbCancel.TabIndex = 8;
this.xbCancel.Text = "取消";
this.xbCancel.set_UseVisualStyleBackColor(false);
this.xbCancel.Click += new EventHandler(this.xbCancel_Click);
this.xbOK.AutoArrangementX = true;
this.xbOK.AutoSizeToImage = false;
this.xbOK.BackColor = Color.Transparent;
this.xbOK.BackgroundImageDisable = null;
this.xbOK.BackgroundImageDown = null;
this.xbOK.BackgroundImageHover = null;
this.xbOK.ChangeSkin = true;
this.xbOK.DialogResult = DialogResult.OK;
this.xbOK.Location = new System.Drawing.Point(0x7b, 180);
this.xbOK.Name = "xbOK";
this.xbOK.Size = new Size(0x4b, 0x17);
this.xbOK.TabIndex = 7;
this.xbOK.Text = "下一步";
this.xbOK.set_UseVisualStyleBackColor(false);
this.xbOK.Click += new EventHandler(this.xbOK_Click);
this.label8.set_AutoSize(true);
this.label8.BackColor = Color.Transparent;
this.label8.Location = new System.Drawing.Point(0x9c, 0xde);
this.label8.Name = "label8";
this.label8.Size = new Size(0, 13);
this.label8.TabIndex = 12;
this.pictureBox1.BackColor = Color.Transparent;
this.pictureBox1.Location = new System.Drawing.Point(6, 13);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new Size(0x4e, 0x42);
this.pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
this.pictureBox1.TabIndex = 13;
this.pictureBox1.TabStop = false;
this.panel1.BackColor = Color.Transparent;
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.pictureBox1);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.label5);
this.panel1.Location = new System.Drawing.Point(7, 10);
this.panel1.Name = "panel1";
this.panel1.Size = new Size(0x155, 0x5d);
this.panel1.TabIndex = 14;
base.set_AutoScaleDimensions(new SizeF(6f, 13f));
base.set_AutoScaleMode(1);
base.BaseHeight = 0x16d;
base.BaseWidth = 0x26a;
base.ClientSize = new Size(0x26a, 0x16d);
base.ControlBox = false;
base.Controls.Add(this.panel1);
base.Controls.Add(this.label8);
base.Controls.Add(this.xbCancel);
base.Controls.Add(this.xbOK);
base.DisplayLocation = new System.Drawing.Point(0x12, 0x26);
base.DisplaySize = new Size(0x26a, 0x16d);
base.Icon = (Icon) manager.GetObject("$this.Icon");
base.MinimizeBox = false;
base.Name = "MobileEmailBindForm";
base.set_Padding(new Padding(1, 0x16, 13, 4));
base.StartPosition = FormStartPosition.CenterParent;
base.Text = "Fetion";
this.pictureBox1.EndInit();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
base.ResumeLayout(false);
base.PerformLayout();
}
private void MobileMailInfo_OperateReturn(object sender, MobileEmailOperateEventArgs e)
{
if (e.Result)
{
this._iFrameworkWindow.UnifiedMessageBox.ShowInfo(this, "手机邮箱绑定成功");
}
else
{
bool? isInRunningProvince = this._user.MobileMailInfo.IsInRunningProvince;
if (!isInRunningProvince.GetValueOrDefault() || !isInRunningProvince.get_HasValue())
{
this._iFrameworkWindow.UnifiedMessageBox.ShowError(this, "对不起。您所在的省份目前无法通过飞信\r\n使用手机邮箱业务。");
}
WebException exception = e.InnerException as WebException;
if (exception == null)
{
this._iFrameworkWindow.UnifiedMessageBox.ShowError(this, "手机邮箱绑定失败");
}
else
{
switch (Convert.ToInt32(((HttpWebResponse) exception.Response).StatusCode))
{
case 0x192:
{
MobileEmailApplyForm form = new MobileEmailApplyForm(this._iFrameworkWindow);
ControlHelper.ShowDialogCenterOnParent(form, this._iFrameworkWindow.MainWindow, true);
goto Label_0113;
}
case 0x194:
this._iFrameworkWindow.UnifiedMessageBox.ShowWarning("手机邮箱已经绑定");
goto Label_0113;
}
this._iFrameworkWindow.UnifiedMessageBox.ShowError(this, "手机邮箱绑定失败");
}
}
Label_0113:
base.Close();
}
private void xbCancel_Click(object sender, EventArgs e)
{
base.DialogResult = DialogResult.Cancel;
base.Close();
}
private void xbOK_Click(object sender, EventArgs e)
{
if (this._user == null)
{
throw new NotImplementedException("Not Support this Method,Maybe Code Error");
}
MobileMailCommandHelper.SendBindRequestAsync(this._user);
this.xbOK.Enabled = false;
this.xbCancel.Enabled = false;
base.DialogResult = DialogResult.OK;
base.Close();
}
private Imps.Client.Core.User _user
{
get
{
return this._iFrameworkWindow.AccountManager.CurrentUser;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -