⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainform.cs

📁 破解的飞信源代码
💻 CS
📖 第 1 页 / 共 5 页
字号:

        protected override void Dispose(bool disposing)
        {
            NickNameStyle.Instance.StyleChanged -= new EventHandler(this.NickNameStyle_StyleChanged);
            MoodPhaseStyle.Instance.StyleChanged -= new EventHandler(this.MoodPhaseStyle_StyleChanged);
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void DoAfterLoaded(object sender, EventArgs e)
        {
            try
            {
                GlobalTimer.Unregister(new EventHandler(this.DoAfterLoaded));
                if (!ConnectionFactory.HasRegisteredConnectionManager())
                {
                    IConnectionManager manager = new ConnectionManagerImp(this.CurrentUser);
                    ConnectionFactory.RegisterConnectionManager(manager);
                }
                Imps.Client.Pc.LiveUpdate.Create(this);
                GlobalTimer.Register(new EventHandler(this.TrayIcon_TimerTick), 5, TimerHandlerPriority.Low);
                this.RegisterTaskbarCreatedMessage();
                if (!Imps.Client.Utils.sensmon.sensmon.try_register())
                {
                    this.UnifiedMessageBox.ShowWarning(this, StringTable.Framework.MsgFailedRegSensMon);
                }
                if (!EnvHelper.DynamicGifCtlRegistered)
                {
                    this.UnifiedMessageBox.ShowWarning(this, StringTable.Framework.MsgFailedRegDynamicGifCtl);
                }
                this.TryLoadHotKey();
                FuncDispatcher.OnEventHandler(this, this.MainWindowLoaded, EventArgs.Empty);
            }
            catch (Exception exception)
            {
                UiErrorHelper.HandExceptionSafely(this, exception);
                base.Close();
            }
        }

        private void DoLocalization()
        {
            this.Text = AppDictionary.CurrentClientName;
        }

        public void Event_OnChannelLogoUpdated(object sender, EventArgs e)
        {
            try
            {
                ChannelItem item = sender as ChannelItem;
                if ((item != null) && (item.Logo != null))
                {
                    ElementPushButton button = (ElementPushButton) base.ElementMgr.Controls.Search(item.ID);
                    if (button != null)
                    {
                        button.Icon = item.Logo;
                        base.Invalidate(button.Rectangle);
                    }
                }
            }
            catch (Exception exception)
            {
                UiErrorHelper.HandExceptionSafely(this._main_form, exception);
            }
        }

        public void Event_OnChannelRetrived(object sender, EventArgs e)
        {
            try
            {
                using (IEnumerator<ChannelItem> enumerator = this._main_form.InnerChannelManager.Items.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        ChannelItem item = enumerator.get_Current();
                        ElementPushButton button = (ElementPushButton) base.ElementMgr.Controls.Search(item.ID);
                        if (button == null)
                        {
                            button = new ElementPushButton();
                            base.AddElement(button);
                            this._chanel_panel.Items.Add(button);
                        }
                        button.NameID = item.ID;
                        button._tooltip = item.Tip;
                        button.ButtonDown += new EventHandler(this.Chanel_ButtonDown);
                        button.Click += new EventHandler(this.chanel_click);
                        this._chanel_buttons.Add(button);
                        button._buttonID = this._chanel_buttons.IndexOf(button);
                        XmlElement elem = ThemeManagerTemp.FindElementConfig(item.ID);
                        if (elem != null)
                        {
                            button._style.SetStyle(elem);
                        }
                        else
                        {
                            button._style.Clone(this._chanel_buttons.get_Item(0)._style);
                        }
                        button.Icon = null;
                        button.OnSizeChanged(base.Width, base.Height);
                    }
                }
                base.ElementMgr.RearrangeElement(this._chanel_panel);
                this._chanel_panel.OnSizeChanged(base.Width, base.Height);
            }
            catch (Exception exception)
            {
                UiErrorHelper.HandExceptionSafely(this._main_form, exception);
            }
        }

        private bool ExistFetionInstance()
        {
            try
            {
                bool flag;
                if (this._evSingleton != null)
                {
                    this._evSingleton.Close();
                    this._evSingleton = null;
                }
                this._evSingleton = new EventWaitHandle(false, 0, @"Local\FetionInstance", ref flag);
                if (!flag)
                {
                    InnerWin32.PostMessage((IntPtr) 0xffff, this.WM_FETIONSTARTED, 0, 0);
                }
                return !flag;
            }
            catch (Exception)
            {
                return false;
            }
        }

        public void friend_click(object sender, EventArgs e)
        {
            this._group_push_button.Visible = true;
            this._contact_push_button.Visible = true;
            this._chanel_tab_name.Visible = false;
            if (this._group_push_button.Down)
            {
                this.PanelControl = this._main_form.PersonalGroupManager.PersonalGroupEntryListControl;
            }
            else
            {
                this.PanelControl = this._main_form.ContactManager.ContactListControl;
            }
        }

        private string GetBuildType()
        {
            return "Release";
        }

        public void group_click(object sender, EventArgs e)
        {
            this._contact_push_button.Down = false;
            this._group_push_button.Down = true;
            base.ElementMgr._rearrange_element = this._group_push_button;
            this.friend_click(this._chanel_buttons.get_Item(0), EventArgs.Empty);
        }

        protected override void HandleBossKey()
        {
            BossKeySensor.GetInstance(this).ProcessBossKey();
            if (BossKey.Hidden)
            {
                this._oldVisible = base.Visible;
                base.Visible = false;
            }
            else
            {
                base.Visible = this._oldVisible;
            }
        }

        private void HandleExceptions()
        {
            Application.ThreadException += new ThreadExceptionEventHandler(this.Application_ThreadException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(this.CurrentDomain_UnhandledException);
        }

        public void HideChanelAndAdvertisement(bool hideChanel, bool hideAdvertisement)
        {
            hideChanel = this.CanHideChanel ? hideChanel : false;
            hideAdvertisement = this.CanHideAdv ? hideAdvertisement : false;
            if (hideChanel && hideAdvertisement)
            {
                this._chanel_panel.Visible = false;
                this._adv_panel.Visible = false;
                this.RaiseHideAdvChanel("HideAll");
            }
            else if (hideChanel)
            {
                this._chanel_panel.Visible = false;
                this._adv_panel.Visible = true;
                this.RaiseHideAdvChanel("HideChanel");
            }
            else if (hideAdvertisement)
            {
                this._chanel_panel.Visible = true;
                this._adv_panel.Visible = false;
                this.RaiseHideAdvChanel("HideAdvertisement");
            }
            else
            {
                this._chanel_panel.Visible = true;
                this._adv_panel.Visible = true;
                this.RaiseHideAdvChanel("default");
            }
            if (hideChanel)
            {
                this.ActiveFriendTab();
            }
            base.Invalidate();
        }

        public void HideMainWindow()
        {
            this.trayIcon.Visible = false;
            this.MainWindow.Hide();
        }

        private void HideOrShow()
        {
            BossKey.Hidden = !BossKey.Hidden;
            this.trayIcon.Visible = !BossKey.Hidden;
        }

        private void InitAllElement()
        {
            this._status_link = new ElementButton();
            this._status_link.NameID = "statusLink";
            this._status_link.Icon = ImpsResources.GetImage("Images.carrier_24X24.png");
            this._status_link.Text = Imps.Client.Core.CarrierSetting.Instance.AdWord;
            this._status_link.Click += new EventHandler(this.status_link_Click);
            this._status_link._font = this.Font;
            this._status_link._font_color = Color.White;
            this._status_link.Style.Cursor = Cursors.Hand;
            this._status_link.Style._location = new System.Drawing.Point(12, 0x22);
            this._status_link.Style._size = new Size(80, 0x1a);
            this._status_link.Style._yAlignment = EAlignment.bottom;
            this._status_link.Style._fontPaddingLeft = 0x19;
            this._title_caption = new ElementStatic();
            this._title_caption.NameID = "titleCaption";
            this._title_caption.Style._location = new System.Drawing.Point(8, 6);
            this._title_caption.Style.Image = (Bitmap) ImpsResources.GetImage("Images.fetion2008.png");
            this._adv_panel = new AdvPanel(this.panel2);
            this._adv_panel.NameID = "AdvPanel";
            this._mail_button = new ElementButton();
            this._mail_button.NameID = "MailButton";
            this._mail_button.Click += new EventHandler(this.mail_click);
            this._regist_mail_button = new ElementButton();
            this._regist_mail_button.NameID = "RegistMail";
            this._regist_mail_button._tooltip = "开通手机邮箱";
            this._regist_mail_button.Click += new EventHandler(this.regist_mail_button_Click);
            this._close_button = new ElementButton();
            this._close_button.NameID = "CloseButton";
            this._close_button._tooltip = "关闭";
            this._close_button.Click += new EventHandler(this.close_click);
            this._minimize_button = new ElementButton();
            this._minimize_button.NameID = "MinButton";
            this._minimize_button._tooltip = "最小化";
            this._minimize_button.Click += new EventHandler(this.minimize_click);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -