📄 mainform.cs
字号:
this._title_menu_button = new ElementButton();
this._title_menu_button.NameID = "TitleMenuButton";
this._title_menu_button._tooltip = "菜单";
this._title_menu_button.Click += new EventHandler(this.menu_click);
this._chg_color_button = new ElementButton();
this._chg_color_button.NameID = "ChangeColorButton";
this._chg_color_button._tooltip = "换色";
this._chg_color_button.Click += new EventHandler(this.changecolor_click);
this._portrait_button = new ElementButton();
this._portrait_button.NameID = "PortraitButton";
this._portrait_button._tooltip = StringTable.User.TipPortrait;
this._portrait_button.Click += new EventHandler(this.portrait_click);
this._portrait_button.Enter += new EventHandler(this._portrait_button_EnterOrLeave);
this._portrait_button.Leave += new EventHandler(this._portrait_button_EnterOrLeave);
this._portrait_dropdown_buttons = new ElementSwitchButton();
this._portrait_dropdown_buttons.NameID = "PortraitDropDown";
this._portrait_dropdown_buttons._tooltip = "头像下拉菜单";
this._portrait_dropdown_buttons.SwitchOn += new EventHandler(this._portrait_dropdown_buttons_SwitchOn);
this._portrait_dropdown_buttons.SwitchOff += new EventHandler(this._portrait_dropdown_buttons_SwitchOff);
this._group_panel = new GroupPanel(this.panel1);
this._group_panel.NameID = "GroupPanel";
this.HideAdvChanel = (PositionEventHandler) Delegate.Combine(this.HideAdvChanel, new PositionEventHandler(this._group_panel.OnPositionChanged));
this._chanel_tab_name = new ElementPushButton();
this._chanel_tab_name.NameID = "ChanelNameTab";
this._chanel_tab_name._font = this.Font;
this._chanel_tab_name.State = ElementButton.ButtonState.STATE_DISABLE;
this._chanel_tab_name.Visible = false;
this._group_push_button = new ElementPushButton();
this._group_push_button.NameID = "GroupButton";
this._group_push_button.Click += new EventHandler(this.group_click);
this._group_push_button.Text = "飞信群";
this._group_push_button._font = this.Font;
this._contact_push_button = new ElementPushButton();
this._contact_push_button.NameID = "ContactButton";
this._contact_push_button.Click += new EventHandler(this.contact_click);
this._contact_push_button.Text = "联系人";
this._contact_push_button._font = this.Font;
this._chanel_buttons = new List<ElementPushButton>();
this._friend_button = new ElementPushButton();
this._friend_button.NameID = "FriendButton";
this._friend_button._tooltip = "好友列表";
this._friend_button._buttonID = 0;
this._friend_button.ButtonDown += new EventHandler(this.Chanel_ButtonDown);
this._friend_button.Click += new EventHandler(this.friend_click);
this._chanel_buttons.Add(this._friend_button);
this._scrollup_button = new ElementButton();
this._scrollup_button.NameID = "ChanelScrollUp";
this._scrollup_button.Visible = false;
this._scrolldown_button = new ElementButton();
this._scrolldown_button.NameID = "ChanelScrollDown";
this._scrolldown_button.Visible = false;
this._chanel_panel = new ChanelPanel();
this._chanel_panel.NameID = "ChanelPanel";
this._chanel_panel.Items.Add(this._chanel_buttons.get_Item(0));
this._scrollup_button.Click += new EventHandler(this._chanel_panel.ScrollUp);
this._scrolldown_button.Click += new EventHandler(this._chanel_panel.ScrollDown);
this.HideAdvChanel = (PositionEventHandler) Delegate.Combine(this.HideAdvChanel, new PositionEventHandler(this._chanel_panel.OnPositionChanged));
this._chanel_panel._scrolldown = this._scrolldown_button;
this._chanel_panel._scrollup = this._scrollup_button;
this._add_button = new ElementButton();
this._add_button.NameID = "AddButton";
this._add_button._tooltip = "添加联系人";
this._add_button.Click += new EventHandler(((Imps.Client.Pc.ContactManager) this._main_form.ContactManager).miAddContact_Click);
this._chat_button = new ElementButton();
this._chat_button.NameID = "ChatButton";
this._chat_button._tooltip = StringTable.User.TipToolIm;
this._chat_button.Click += new EventHandler(((BUserInfoControl) this._main_form.AccountManager.UserInfoControl).toolIm_Click);
this._sms_button = new ElementButton();
this._sms_button.NameID = "SmsButton";
this._sms_button._tooltip = StringTable.User.TipToolSms;
this._sms_button.Click += new EventHandler(((BUserInfoControl) this._main_form.AccountManager.UserInfoControl).toolSms_Click);
this._phone_chat_button = new ElementButton();
this._phone_chat_button.NameID = "PhonechatButton";
this._phone_chat_button._tooltip = StringTable.User.TipToolIvr;
this._phone_chat_button.Click += new EventHandler(((BUserInfoControl) this._main_form.AccountManager.UserInfoControl).toolIVR_Click);
this._menu_button = new ElementButton();
this._menu_button.NameID = "MenuButton";
this._menu_button._tooltip = "主菜单";
this._menu_button.Text = "菜单";
this._menu_button._font = this.Font;
this._menu_button.Click += new EventHandler(this.menu_click);
this.AddUserInfoElements();
}
private void InitializeComponent()
{
this.components = new Container();
ComponentResourceManager manager = new ComponentResourceManager(typeof(MainForm));
this.trayIcon = new NotifyIcon(this.components);
this.timerMain = new System.Windows.Forms.Timer(this.components);
this.panel1 = new Panel();
this.panel2 = new Panel();
base.SuspendLayout();
this.trayIcon.add_MouseClick(new MouseEventHandler(this.trayIcon_MouseClick));
this.timerMain.Enabled = true;
this.timerMain.Tick += new EventHandler(this.timerMain_Tick);
this.panel1.BackColor = Color.Transparent;
this.panel1.Location = new System.Drawing.Point(0x75, 0x9f);
this.panel1.Name = "panel1";
this.panel1.Size = new Size(0x62, 0x30);
this.panel1.TabIndex = 3;
this.panel2.BackColor = Color.Transparent;
this.panel2.Location = new System.Drawing.Point(0x4f, 0x16c);
this.panel2.Name = "panel2";
this.panel2.Size = new Size(200, 0x5c);
this.panel2.TabIndex = 4;
base.set_AutoScaleDimensions(new SizeF(6f, 12f));
base.set_AutoScaleMode(1);
this.BackColor = Color.FromArgb(0xe0, 0xe0, 0xe0);
base.ClientSize = new Size(0x144, 0x249);
base.Controls.Add(this.panel2);
base.Controls.Add(this.panel1);
base.Icon = (Icon) manager.GetObject("$this.Icon");
base.KeyPreview = true;
base.Location = new System.Drawing.Point(0x13, 0x2d);
base.MaximizeBox = false;
this.set_MinimumSize(new Size(300, 390));
base.Name = "MainForm";
base.set_Padding(new Padding(3, 1, 2, 2));
this.Text = "Fetion 2008";
base.SizeChanged += new EventHandler(this.MainUIForm_SizeChanged);
base.KeyDown += new KeyEventHandler(this.MainUIForm_KeyDown);
base.ResumeLayout(false);
}
private void InitializeMyComponent()
{
ComponentResourceManager manager = new ComponentResourceManager(typeof(BUserInfoControl));
this.ctlNickname = new BDisplayNameAndOnlineStatus();
this.ctlMoodPhrase = new BDisplayPersonalMessage();
base.SuspendLayout();
this.ctlNickname.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
this.ctlNickname.BackColor = Color.White;
this.ctlNickname.DisplayName = "游客";
this.ctlNickname.DisplayNameFont = new Font("SimSun", 9f, FontStyle.Bold);
this.ctlNickname.DisplayNameForeColor = Color.FromArgb(100, 100, 100);
this.ctlNickname.DropDownButtonImage = (Image) manager.GetObject("ctlNickname.DropDownButtonImage");
this.ctlNickname.DropDownMenu = ((BUserInfoControl) this._main_form.AccountManager.UserInfoControl).StatusMenu;
this.ctlNickname.Location = new System.Drawing.Point(0x51, 0x22);
this.ctlNickname.MouseDownBackColor = Color.White;
this.ctlNickname.MouseDownBackgroundImage = (Image) manager.GetObject("ctlNickname.MouseDownBackgroundImage");
this.ctlNickname.MouseDownBorderColor = Color.FromArgb(0x98, 200, 0xe8);
this.ctlNickname.MouseOverBackColor = Color.FromArgb(0xda, 220, 0xee);
this.ctlNickname.MouseOverBackgroundImage = (Image) manager.GetObject("ctlNickname.MouseOverBackgroundImage");
this.ctlNickname.MouseOverBorderColor = Color.FromArgb(0x48, 0x90, 200);
this.ctlNickname.Name = "ctlNickname";
this.ctlNickname.OnlineStatusText = "(在线)";
this.ctlNickname.OnlineStatusTextFont = new Font("SimSun", 9f);
this.ctlNickname.OnlineStatusTextForeColor = Color.FromArgb(100, 100, 100);
this.ctlNickname.Size = new Size(0x9d, 0x16);
this.ctlNickname.TabIndex = 4;
this.ctlNickname.ToolTipText = "";
this.ctlMoodPhrase.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
this.ctlMoodPhrase.BackColor = Color.White;
this.ctlMoodPhrase.DropDownButtonImage = (Image) manager.GetObject("ctlMoodPhrase.DropDownButtonImage");
this.ctlMoodPhrase.DropdownButtonTootipText = "显示您的心情短语历史";
this.ctlMoodPhrase.DropDownMenu = ((BUserInfoControl) this._main_form.AccountManager.UserInfoControl).MoodPhraseMenu;
this.ctlMoodPhrase.EmptyPersonalMessageTextForeColor = Color.Silver;
this.ctlMoodPhrase.Font = new Font("Arial", 9f);
this.ctlMoodPhrase.ForeColor = Color.FromArgb(100, 100, 100);
this.ctlMoodPhrase.Location = new System.Drawing.Point(0x51, 0x38);
this.ctlMoodPhrase.MaxLength = 0x7fffffff;
this.ctlMoodPhrase.MouseDownBackColor = Color.White;
this.ctlMoodPhrase.MouseDownBackgroundImage = (Image) manager.GetObject("ctlMoodPhrase.MouseDownBackgroundImage");
this.ctlMoodPhrase.MouseDownBorderColor = Color.FromArgb(0x98, 200, 0xe8);
this.ctlMoodPhrase.MouseOverBackColor = Color.FromArgb(0xda, 220, 0xee);
this.ctlMoodPhrase.MouseOverBackgroundImage = (Image) manager.GetObject("ctlMoodPhrase.MouseOverBackgroundImage");
this.ctlMoodPhrase.MouseOverBorderColor = Color.FromArgb(0x48, 0x90, 200);
this.ctlMoodPhrase.Name = "ctlMoodPhrase";
this.ctlMoodPhrase.PersonalMessageText = "";
this.ctlMoodPhrase.Size = new Size(0x9d, 0x16);
this.ctlMoodPhrase.TabIndex = 4;
this.ctlMoodPhrase.TextboxBorderColor = Color.FromArgb(0x98, 0x97, 0x8b);
this.ctlMoodPhrase.TextBoxAccepted += new EventHandler(this.displayPersonalMessage_TextBoxAccepted);
base.Controls.Add(this.ctlNickname);
base.Controls.Add(this.ctlMoodPhrase);
NickNameStyle.Instance.StyleChanged += new EventHandler(this.NickNameStyle_StyleChanged);
MoodPhaseStyle.Instance.StyleChanged += new EventHandler(this.MoodPhaseStyle_StyleChanged);
this._main_form.AccountManager.CurrentUser.PersonalInfo.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.ActiveUser_PersonalInfoChanged);
this.ctlNickname.ToolTipText = StringTable.User.TipNickname;
this.ctlNickname.DisplayName = this._main_form.AccountManager.CurrentUser.Nickname;
this.ctlNickname.OnlineStatusText = "(" + ((EntryPointControl) this._main_form.AccountManager.EntryPointControl).InitStatusText + ")";
this.ctlMoodPhrase.MaxLength = 0x100;
this.ctlMoodPhrase.ToolTipText = StringTable.User.TipMoodPhrase;
this.ctlMoodPhrase.EmptyPersonalMessageText = StringTable.User.UI_MoodPhraseHint;
this.SetMoodPhrase((string) this._main_form.AccountManager.CurrentUser.Presence.MoodPhrase);
this.panel2.Controls.Add(this._main_form.AdBar.Bar);
this._main_form.AdBar.Bar.Dock = DockStyle.Fill;
this._main_form.AdBar.Bar.set_Padding(new Padding(0));
this._main_form.PortraitDropDownMenu.add_Opening(new CancelEventHandler(this.PortraitDropDownMenu_Opening));
this._main_form.PortraitDropDownMenu.add_Closed(new ToolStripDropDownClosedEventHandler(this, (IntPtr) this.PortraitDropDownMenu_Closed));
this._main_form.PortraitDropDownMenu.add_Closing(new ToolStripDropDownClosingEventHandler(this, (IntPtr) this.PortraitDropDownMenu_Closing));
this._main_form.AccountManager.CurrentUser.MobileMailInfo.UnReadMailChanged += new EventHandler(this.MobileMailInfo_UnReadMailChanged);
this._main_form.AccountManager.CurrentUser.MobileMailInfo.BindInfoChanged += new EventHandler(this.MobileMailInfo_BindInfoChanged);
this.InnerChannelManager.OnChannelLogoUpdated += new EventHandler(this.Event_OnChannelLogoUpdated);
this.InnerChannelManager.OnChannelRetrived += new EventHandler(this.Event_OnChannelRetrived);
base.ResumeLayout(false);
base.PerformLayout();
}
private void InitLogger()
{
string argsStr = Imps.Client.Core.FixedClientSetting.Instance.LoggerArgs;
ImpsLogger logger = new ImpsLogger(this);
logger.LogHeader.AppEnv.AppName = Imps.Client.Core.Configuration.FixedClientSetting.AppName;
logger.LogHeader.AppEnv.Version = string.Format("{0}(Build {1}) - {2}", Imps.Client.Core.Configuration.FixedClientSetting.Version, Imps.Client.Core.Configuration.FixedClientSetting.BuildDate, Imps.Client.Core.Configuration.FixedClientSetting.Branch);
logger.IsLogException = true;
logger.IsLogInstall = true;
ClientLogger.Logger = logger;
TryParseLoggerArgs(logger, argsStr);
}
private void InitLogonHook()
{
try
{
if (this.m_sens_lock_proc == null)
{
lock (this._syncObjSensor)
{
if (this.m_sens_lock_proc == null)
{
this.m_sens_lock_proc = new Imps.Client.Utils.sensmon.sensmon.sens_simple_notify_proc_type(this.on_sens_lock);
Imps.Client.Utils.sensmon.sensmon.simple_subscribe(Imps.Client.Utils.sensmon.sensmon.event_id.sens_displayunlock, this.m_sens_lock_proc, IntPtr.Zero);
}
}
}
}
catch (Exception exception)
{
ClientLogger.WriteException("Failed to subscribing unlock event", exception);
}
}
private void InitMailButtons()
{
if ((this._mail_button != null) && (this._regist_mail_button != null))
{
if (FuncLimitedSetting.MobileEmailFuncLimited)
{
this._mail_button.Visible = false;
this._regist_mail_button.Visible = false;
}
else
{
bool? isInRunningProvince = this._main_form.AccountManager.CurrentUser.MobileMailInfo.IsInRunningProvince;
if ((isInRunningProvince.GetValueOrDefault() && isInRunningProvince.get_HasValue()) && MobileMailCommandHelper.CheckMailStatus(this._main_form.AccountManager.CurrentUser))
{
int? nullable3 = this._main_form.AccountManager.CurrentUser.MobileMailInfo.Binding_Status;
if ((nullable3.GetValueOrDefault() == 0) && nullable3.get_HasValue())
{
this._regist_mail_button.Visible = false;
this._mail_button.Visible = true;
int? unReadMailCount = this._main_form.AccountManager.CurrentUser.MobileMailInfo.UnReadMailCount;
if (!unReadMailCount.get_HasValue())
{
unReadMailCount = 0;
}
this._mail_button._tooltip = string.Format("您有{0}封未读邮件", unReadMailCount);
this._mail_button.Text = string.Format("({0})", unReadMailCount);
return;
}
}
this._mail_button.Visible = false;
this._regist
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -