?? addmobilebuddyfeedbackform.cs
字號:
?namespace Imps.Client.Pc.UIContactList.AddBuddy
{
using Imps.Client;
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.Windows.Forms;
public class AddMobileBuddyFeedbackForm : XIMDialog
{
private IFrameworkWindow _iFrameworkWindow;
private Imps.Client.Core.MobileBuddy _mobileBuddy;
private Imps.Client.Core.User _user;
private XButton buttonCancel;
private XButton buttonOK;
private CheckBox checkBoxOpenIIC;
private IContainer components;
private XLabel labelIIC;
private XLabel labelNickname;
private Panel panel1;
private DisplayPortrait pictureBoxMobile;
private XTextBox textBoxLocalName;
public AddMobileBuddyFeedbackForm(IFrameworkWindow iFrameworkWindow, Imps.Client.Core.MobileBuddy mobileBuddy)
{
this.InitializeComponent();
this.initComponentRegion();
this._iFrameworkWindow = iFrameworkWindow;
this._mobileBuddy = mobileBuddy;
this._user = this._iFrameworkWindow.AccountManager.CurrentUser;
this._user.StatusChanged += new EventHandler<UserSatusChangedEventArgs>(this._user_StatusChanged);
ControlHelper.ForceControlImeHangul(this.textBoxLocalName);
}
private void _user_StatusChanged(object sender, UserSatusChangedEventArgs e)
{
if (((e.NewStatus == UserAccountStatus.Disconnected) || (e.NewStatus == UserAccountStatus.Logoff)) || (e.NewStatus == UserAccountStatus.Logouting))
{
base.Close();
}
}
private void AddMobileBuddyFeedbackForm_Load(object sender, EventArgs e)
{
base.Icon = ImpsIcons.AddBuddyIcon;
this.pictureBoxMobile.Image = ImpsPortrait.GetMobilePortrait(0x60, 0x60);
this.labelIIC.Text = string.Format(StringTable.FormAddBuddy.OpenIIC, this._mobileBuddy.PersonalInfo.MobileNo, AppDictionary.ShortEnglishName);
string userSetDataProposedValue = string.Empty;
if (this._mobileBuddy.PersonalInfo.Name.HasUserSetData && !string.IsNullOrEmpty(this._mobileBuddy.PersonalInfo.Name.UserSetDataProposedValue))
{
userSetDataProposedValue = this._mobileBuddy.PersonalInfo.Name.UserSetDataProposedValue;
}
this.textBoxLocalName.MaxLength = 0x40;
if (userSetDataProposedValue.Length <= this.textBoxLocalName.MaxLength)
{
this.textBoxLocalName.Text = userSetDataProposedValue;
}
else
{
this.textBoxLocalName.Text = userSetDataProposedValue.Substring(0, this.textBoxLocalName.MaxLength);
}
}
private void buttonCancel_Click(object sender, EventArgs e)
{
base.Close();
}
private void buttonOK_Click(object sender, EventArgs e)
{
try
{
AsyncBizOperation op = new AsyncBizOperation();
if (this.textBoxLocalName.Text.Trim().Length > 0)
{
this._mobileBuddy.PersonalInfo.Name.UserSetDataProposedValue = this.textBoxLocalName.Text;
this._mobileBuddy.PersonalInfo.CommitChanges(op);
}
if (this.checkBoxOpenIIC.Checked)
{
Imps.Client.Core.Contact.AsyncInviteMobileOpenIMPSService(this._mobileBuddy.PersonalInfo.MobileNo, string.Empty, this._user, op);
}
base.Close();
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
}
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new Container();
ComponentResourceManager manager = new ComponentResourceManager(typeof(AddMobileBuddyFeedbackForm));
this.labelNickname = new XLabel();
this.labelIIC = new XLabel();
this.textBoxLocalName = new XTextBox();
this.checkBoxOpenIIC = new CheckBox();
this.buttonCancel = new XButton();
this.buttonOK = new XButton();
this.panel1 = new Panel();
this.pictureBoxMobile = new DisplayPortrait();
XLabel label = new XLabel();
XLabel label2 = new XLabel();
XLabel label3 = new XLabel();
XLabel label4 = new XLabel();
this.panel1.SuspendLayout();
base.SuspendLayout();
base.menubar.Location = new Point(3, 0x19);
label.AutoSize = true;
label.BackColor = Color.Transparent;
label.BorderColor = Color.Empty;
label.ButtonBorderStyle = ButtonBorderStyle.None;
label.Font = new Font("Microsoft Sans Serif", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
label.ForeColor = Color.RoyalBlue;
label.Location = new Point(5, 6);
label.Name = "label6";
label.Size = new Size(0x7c, 15);
label.TabIndex = 0;
label.Text = "添加手機好友成功!";
label.UseMnemonic = false;
label2.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
label2.BorderColor = Color.Empty;
label2.BorderStyle = BorderStyle.Fixed3D;
label2.ButtonBorderStyle = ButtonBorderStyle.None;
label2.Location = new Point(0x7d, 13);
label2.Name = "label4";
label2.Size = new Size(400, 3);
label2.TabIndex = 1;
label2.UseMnemonic = false;
label3.AutoSize = true;
label3.BackColor = Color.Transparent;
label3.BorderColor = Color.Empty;
label3.ButtonBorderStyle = ButtonBorderStyle.None;
label3.Font = new Font("Microsoft Sans Serif", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
label3.ForeColor = Color.RoyalBlue;
label3.Location = new Point(6, 0x72);
label3.Name = "label1";
label3.Size = new Size(0x3b, 15);
label3.TabIndex = 3;
label3.Text = "后續操作";
label3.UseMnemonic = false;
label4.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
label4.BorderColor = Color.Empty;
label4.BorderStyle = BorderStyle.Fixed3D;
label4.ButtonBorderStyle = ButtonBorderStyle.None;
label4.Location = new Point(0x3d, 0x79);
label4.Name = "label2";
label4.Size = new Size(420, 2);
label4.TabIndex = 4;
label4.Text = "label2";
label4.UseMnemonic = false;
this.labelNickname.AutoSize = true;
this.labelNickname.BackColor = Color.Transparent;
this.labelNickname.BorderColor = Color.Empty;
this.labelNickname.ButtonBorderStyle = ButtonBorderStyle.None;
this.labelNickname.Location = new Point(0x1a, 0x8b);
this.labelNickname.Name = "labelNickname";
this.labelNickname.Size = new Size(0x10f, 13);
this.labelNickname.TabIndex = 5;
this.labelNickname.Text = "請輸入對方的名稱,在好友列表中可以方便地瀏覽";
this.labelNickname.UseMnemonic = false;
this.labelIIC.BackColor = Color.Transparent;
this.labelIIC.BorderColor = Color.Empty;
this.labelIIC.ButtonBorderStyle = ButtonBorderStyle.None;
this.labelIIC.Location = new Point(15, 0x1c);
this.labelIIC.Name = "labelIIC";
this.labelIIC.Size = new Size(0x107, 0x45);
this.labelIIC.TabIndex = 2;
this.labelIIC.Text = @"手機用戶{0}尚未開通{1}服務,但您仍然可以:\r\n 向他/她發送短信";
this.labelIIC.UseMnemonic = false;
this.textBoxLocalName.BackColor = Color.White;
this.textBoxLocalName.BorderStyle = BorderStyle.FixedSingle;
this.textBoxLocalName.Location = new Point(0x1d, 0x9e);
this.textBoxLocalName.MaxLength = 0x40;
this.textBoxLocalName.Name = "textBoxLocalName";
this.textBoxLocalName.Size = new Size(0x10c, 20);
this.textBoxLocalName.TabIndex = 6;
this.checkBoxOpenIIC.AutoSize = true;
this.checkBoxOpenIIC.BackColor = Color.Transparent;
this.checkBoxOpenIIC.Location = new Point(0x1d, 0xbd);
this.checkBoxOpenIIC.Name = "checkBoxOpenIIC";
this.checkBoxOpenIIC.Size = new Size(0xf7, 0x11);
this.checkBoxOpenIIC.TabIndex = 7;
this.checkBoxOpenIIC.Text = "我覺得Fetion服務不錯,邀請對方也來加入";
this.checkBoxOpenIIC.UseVisualStyleBackColor = false;
this.buttonCancel.DialogResult = DialogResult.Cancel;
this.buttonCancel.Location = new Point(0x13d, 0xd4);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new Size(0x4b, 0x17);
this.buttonCancel.TabIndex = 9;
this.buttonCancel.Text = "取消";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new EventHandler(this.buttonCancel_Click);
this.buttonOK.Location = new Point(0xec, 0xd4);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new Size(0x4b, 0x17);
this.buttonOK.TabIndex = 8;
this.buttonOK.Text = "確定";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new EventHandler(this.buttonOK_Click);
this.panel1.BackColor = Color.Transparent;
this.panel1.Controls.Add(this.pictureBoxMobile);
this.panel1.Controls.Add(label3);
this.panel1.Controls.Add(label);
this.panel1.Controls.Add(this.buttonOK);
this.panel1.Controls.Add(this.checkBoxOpenIIC);
this.panel1.Controls.Add(this.buttonCancel);
this.panel1.Controls.Add(this.textBoxLocalName);
this.panel1.Controls.Add(this.labelIIC);
this.panel1.Controls.Add(label2);
this.panel1.Controls.Add(this.labelNickname);
this.panel1.Controls.Add(label4);
this.panel1.Dock = DockStyle.Fill;
this.panel1.Location = new Point(8, 8);
this.panel1.Name = "panel1";
this.panel1.Size = new Size(0x1a2, 0x123);
this.panel1.TabIndex = 0;
this.pictureBoxMobile.BackColor = Color.White;
this.pictureBoxMobile.BorderColor = Color.FromArgb(0xa4, 170, 220);
this.pictureBoxMobile.Image = (Image) manager.GetObject("pictureBoxMobile.Image");
this.pictureBoxMobile.Location = new Point(0x126, 0x12);
this.pictureBoxMobile.Name = "pictureBoxMobile";
this.pictureBoxMobile.ShowSecondBorder = false;
this.pictureBoxMobile.Size = new Size(0x66, 0x66);
this.pictureBoxMobile.TabIndex = 3;
this.pictureBoxMobile.ToolTipText = "";
this.pictureBoxMobile.Click += new EventHandler(this.pictureBoxMobile_Click);
base.AcceptButton = this.buttonOK;
base.AutoScaleDimensions = new SizeF(6f, 13f);
base.AutoScaleMode = AutoScaleMode.Font;
base.CancelButton = this.buttonCancel;
base.ClientSize = new Size(0x1b2, 0x133);
base.Controls.Add(this.panel1);
base.FormBorderStyle = FormBorderStyle.FixedSingle;
base.Icon = (Icon) manager.GetObject("$this.Icon");
base.Name = "AddMobileBuddyFeedbackForm";
base.Padding = new Padding(8);
base.Text = "添加手機好友反饋";
base.Load += new EventHandler(this.AddMobileBuddyFeedbackForm_Load);
base.Controls.SetChildIndex(this.panel1, 0);
base.Controls.SetChildIndex(base.menubar, 0);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
base.ResumeLayout(false);
}
protected override void OnFormClosed(FormClosedEventArgs e)
{
this._user.StatusChanged -= new EventHandler<UserSatusChangedEventArgs>(this._user_StatusChanged);
base.OnFormClosed(e);
}
private void pictureBoxMobile_Click(object sender, EventArgs e)
{
this._iFrameworkWindow.ContactManager.ShowContactDetail(this._mobileBuddy.Uri.Raw);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -