📄 contact_tip_widget.cs
字号:
base.set_AutoScaleMode(1);
this.BackColor = Color.FromArgb(0xf7, 250, 0xf8);
base.ClientSize = new Size(240, 0xec);
base.ControlBox = false;
base.Controls.Add(this.m_link_buy);
base.Controls.Add(this.m_close_button);
base.FormBorderStyle = FormBorderStyle.None;
base.MaximizeBox = false;
base.MinimizeBox = false;
base.Name = "contact_tip_widget";
base.set_ShowIcon(false);
base.ShowInTaskbar = false;
base.StartPosition = FormStartPosition.Manual;
this.Text = "contact_tip_widget";
base.ResumeLayout(false);
base.PerformLayout();
}
private void InitializeWndlessComponent()
{
this._wndlessControls = new WndlessControlCollection(this);
this.m_link_phonenum = new WndlessLinkLabel();
this.m_link_account = new WndlessLinkLabel();
this._score_level_control = new WndlessScorePictureBox();
this._score_level_control.AutoSize = true;
this._wndlessControls.Add(this._score_level_control);
this.m_link_phonenum.AutoSize = true;
this.m_link_phonenum.LinkBehavior = LinkBehavior.HoverUnderline;
this.m_link_phonenum.ForeColor = Color.FromArgb(0, 0x66, 0xa7);
this.m_link_phonenum.Location = new System.Drawing.Point(90, 0x3e4);
this.m_link_phonenum.Text = "";
this.m_link_phonenum.Click += new EventHandler(this.on_click_link_phonenumOrAccount);
this.m_link_account.AutoSize = true;
this.m_link_account.LinkBehavior = LinkBehavior.HoverUnderline;
this.m_link_account.ForeColor = Color.FromArgb(0, 0x66, 0xa7);
this.m_link_account.Location = new System.Drawing.Point(90, 0x396);
this.m_link_account.Text = "";
this.m_link_account.Click += new EventHandler(this.on_click_link_phonenumOrAccount);
this._wndlessControls.Add(this.m_link_phonenum);
this._wndlessControls.Add(this.m_link_account);
}
private void Instance_StyleChanged(object sender, EventArgs e)
{
base.Invalidate();
}
private void on_click_close(object sender, EventArgs e)
{
if (base.IsHandleCreated && !base.IsDisposed)
{
base.Hide();
}
}
private void on_click_headicon()
{
try
{
base.Hide();
if (this.m_contact == null)
{
this.iframe.ShowOptions(this.iframe.MainWindow, "PsGeneral");
}
else
{
this.iframe.ContactManager.ShowContactDetail(this.iframe.MainWindow, this.m_contact.Uri.Raw);
}
}
catch (Exception exception)
{
ClientLogger.WriteGeneral("ContactTip", exception.ToString(), 10);
}
}
private void on_click_link_phonenumOrAccount(object sender, EventArgs e)
{
this.start_chat();
}
private void on_click_score_level()
{
try
{
base.Hide();
ShellHelper.StartUrl(this.iframe.AccountManager.CurrentUser.Configuration.SystemSetting.SysClientSetting.NN_ScoreFaqUrl);
}
catch (Exception exception)
{
ClientLogger.WriteGeneral("ContactTip", exception.ToString(), 10);
}
}
private void on_contact_blockchanged(object sender, BlockEventArgs e)
{
try
{
this.do_paint();
}
catch (Exception exception)
{
ClientLogger.WriteGeneral("ContactTip", exception.ToString(), 10);
}
}
private void on_contact_personalinfo_changed(object sender, PropertiesChangedEventArgs e)
{
try
{
bool flag = false;
if (e.ContainsProperty("nickname"))
{
this.m_nickname.plane_text = (string) this.m_contact.PersonalInfo.Nickname;
flag = true;
}
if (e.ContainsProperty("DisplayName"))
{
this.m_name.plane_text = this.m_contact.PersonalInfo.DisplayName;
flag = true;
}
if (e.ContainsProperty("impresa"))
{
this.m_personal_msg.plane_text = this.m_contact.Presence.MoodPhrase;
flag = true;
}
if (e.ContainsProperty("score-level"))
{
flag = true;
}
if (e.ContainsProperty("Portrait") && !flag)
{
base.Invalidate(this.m_headicon_bounds);
}
if (flag)
{
this.update_bounds(this.m_contact_rect);
this.do_paint();
}
}
catch (Exception exception)
{
ClientLogger.WriteGeneral("ContactTip", exception.ToString(), 10);
}
}
private void on_contact_presence_changed(object sender, PropertiesChangedEventArgs e)
{
try
{
bool flag = false;
if (e.ContainsProperty("MoodPhrase"))
{
this.m_personal_msg.plane_text = this.m_contact.Presence.MoodPhrase;
this.update_buttons_state();
this.update_bounds(this.m_contact_rect);
flag = true;
}
else if (e.ContainsAnyOfProperties(new string[] { "value", "desc" }))
{
flag = true;
}
if (flag)
{
this.do_paint();
}
}
catch (Exception exception)
{
ClientLogger.WriteGeneral("ContactTip", exception.ToString(), 10);
}
}
private void on_download_crbt_err(object sender, ImpsErrorEventArgs args)
{
if (UserAccountStatus.Logon == this.iframe.AccountManager.CurrentUser.Status)
{
try
{
if ((500 == args.ErrorType) || (0x1f8 == args.ErrorType))
{
DialogResult result = UiErrorHelper.ShowImpsAlert(this.iframe, this, args, MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk);
if (DialogResult.Yes == result)
{
AsyncBizOperation op = new AsyncBizOperation(args.Context);
op.ImpsError += new EventHandler<ImpsErrorEventArgs>(this, (IntPtr) this.on_set_default_crbttobuddy_err);
this.iframe.AccountManager.CurrentUser.Presence.AsyncSetDefaultCrbtToBuddy((CrbtToBuddy) args.Context, op);
}
}
else
{
UiErrorHelper.ShowImpsError(this.iframe, this, args);
}
}
catch (Exception exception)
{
ClientLogger.WriteGeneral("ContactTip", exception.ToString(), 10);
}
this.m_link_buy.Enabled = true;
}
}
private void on_link_buy_clicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (MouseButtons.Left == e.get_Button())
{
try
{
AsyncBizOperation op = new AsyncBizOperation(this.m_contact);
op.ImpsError += new EventHandler<ImpsErrorEventArgs>(this, (IntPtr) this.on_download_crbt_err);
this.m_link_buy.Enabled = false;
this.iframe.AccountManager.CurrentUser.Presence.AsyncDownloadBuddyCrbt(this.m_contact, op);
}
catch (Exception exception)
{
ClientLogger.WriteGeneral("ContactTip", exception.ToString(), 10);
}
}
}
protected void on_page_mousedown_proc(contact_tip_page page, int page_top, object context, ref bool cancel)
{
on_page_mousedown_args _args = context as on_page_mousedown_args;
if ((_args.m_cursor_position.Y > page_top) && (_args.m_cursor_position.Y < (page_top + this.m_page_title_height)))
{
this.m_crbttome_page.show_detail = !this.m_crbttome_page.show_detail;
this.do_paint();
if (this.m_crbttome_page.show_detail && this.m_crbttome_page.IsValid())
{
if (this.m_player != null)
{
if (this.m_player.IsHandleCreated && !this.m_player.IsDisposed)
{
this.m_link_buy.Location = new System.Drawing.Point((base.ClientRectangle.Right - this.m_rightbottom_margin.Width) - this.m_link_buy.Width, ((base.ClientRectangle.Bottom - 0x2e) - (this.m_crbttome_page.size.Height / 2)) + (((this.m_crbttome_page.size.Height / 2) - this.m_link_buy.Height) / 2));
}
else
{
this.m_link_buy.Location = new System.Drawing.Point((base.ClientRectangle.Right - this.m_rightbottom_margin.Width) - this.m_link_buy.Width, (base.ClientRectangle.Bottom - (this.m_crbttome_page.size.Height / 2)) + (((this.m_crbttome_page.size.Height / 2) - this.m_link_buy.Height) / 2));
}
}
else
{
this.m_link_buy.Location = new System.Drawing.Point((base.ClientRectangle.Right - this.m_rightbottom_margin.Width) - this.m_link_buy.Width, (base.ClientRectangle.Bottom - (this.m_crbttome_page.size.Height / 2)) + (((this.m_crbttome_page.size.Height / 2) - this.m_link_buy.Height) / 2));
}
}
this.show_buttons(this.m_crbttome_page.show_detail && this.m_crbttome_page.IsValid(), new Control[] { this.m_link_buy });
}
}
protected void on_page_mousemove_proc(contact_tip_page page, int page_top, object context, ref bool cancel)
{
on_page_mousemove_args _args = context as on_page_mousemove_args;
if ((_args.m_cursor_position.Y > page_top) && (_args.m_cursor_position.Y < (page_top + this.m_page_title_height)))
{
_args.m_hitted = true;
cancel = true;
}
}
private void on_play_crbt()
{
if ((this.m_close_button.state_image != null) && this.m_crbttome_page.IsValid())
{
this.m_close_button.Location = new System.Drawing.Point((base.ClientRectangle.Right - this.m_rightbottom_margin.Width) - (this.m_close_button.state_image.Width / 4), base.ClientRectangle.Top + ((this.m_titlebar_height - this.m_close_button.state_image.Height) / 2));
this.m_close_button.Size = new Size(this.m_close_button.state_image.Width / 4, this.m_close_button.state_image.Height);
this.m_close_button.Visible = true;
this.paint_title_bar();
}
}
private void on_player_created(Control owner, AxWindowsMediaPlayer player, object context)
{
try
{
this.m_player = player;
if (this.m_player == null)
{
this.update_bounds(this.m_contact_rect);
this.do_paint();
this.on_selected_page_changed();
}
else
{
this.m_player.PlayStateChange += new AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler(this.on_player_playstatechange);
this.m_player.ErrorEvent += new EventHandler(this.on_player_errorevent);
this.on_selected_page_changed();
if (((this.m_player != null) && this.m_player.IsHandleCreated) && !this.m_player.IsDisposed)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -