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

📄 mainform.cs

📁 破解的飞信源代码
💻 CS
📖 第 1 页 / 共 5 页
字号:
namespace Imps.Client.Pc
{
    using Imps.Client;
    using Imps.Client.Base;
    using Imps.Client.CommLayer;
    using Imps.Client.Core;
    using Imps.Client.Logger;
    using Imps.Client.Pc.BizControls;
    using Imps.Client.Pc.MessageHistory2;
    using Imps.Client.Pc.Options;
    using Imps.Client.Pc.Sensor;
    using Imps.Client.Pc.Theme;
    using Imps.Client.Pc.UIContactList;
    using Imps.Client.Pc.UserAccount;
    using Imps.Client.Resource;
    using Imps.Client.Utils;
    using Imps.Client.Utils.sensmon;
    using Imps.Client.Utils.Win32;
    using Imps.Common;
    using Imps.Utils;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.IO;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using System.Text;
    using System.Threading;
    using System.Windows.Forms;
    using System.Xml;

    public class MainForm : EForm, IFrameworkWindow
    {
        private IAdBar _adBar;
        private ElementButton _add_button;
        private AdvPanel _adv_panel;
        private List<ElementPushButton> _chanel_buttons;
        private ChanelPanel _chanel_panel;
        private ElementPushButton _chanel_tab_name;
        private menu_widget _changeColorMenu;
        private ElementButton _chat_button;
        private ElementButton _chg_color_button;
        private ElementButton _close_button;
        private ElementPushButton _contact_push_button;
        public bool _disableHotKey;
        private EventWaitHandle _evSingleton;
        private ElementPushButton _friend_button;
        private OptionsForm _frmOptions;
        private GroupPanel _group_panel;
        private ElementPushButton _group_push_button;
        private menu_widget _helpMenu;
        private uint _hotKey;
        private uint _hotKeyBoss;
        private ElementButton _mail_button;
        private MainForm _main_form;
        private string _mainAppPath;
        private ElementButton _menu_button;
        private IUserAccountManager _mgrAccount;
        private IChannelManager _mgrChannel;
        private IContactManager _mgrContact;
        private IConversationManager _mgrConversation;
        private GroupOptionsManager _mgrGroupOptions;
        private IImportExportManager _mgrImportExportManager;
        private IIVRManager _mgrIVRManager;
        private IMessageHistoryManager _mgrMessageHistory;
        private IOptionsManager _mgrOptions;
        private IPersistentManager _mgrPersistent;
        private IPersonalGroupManager _mgrPersonalGroup;
        private Imps.Client.Pc.SystemMessageManager _mgrSysMsg;
        private menu_radioitem _miMessageBySms;
        private menu_radioitem _miMessageNotBySms;
        private ToolStripMenuItem _miMobilemail;
        private ElementButton _minimize_button;
        private bool _oldVisible;
        private ElementButton _phone_chat_button;
        private ElementButton _portrait_button;
        private ElementSwitchButton _portrait_dropdown_buttons;
        private menu_widget _portraitDropDownMenu;
        private ElementButton _regist_mail_button;
        private ElementButton _scrolldown_button;
        private ElementButton _scrollup_button;
        private ElementButton _sms_button;
        private ElementButton _status_link;
        private volatile bool _suspended;
        private object _syncObjSensor;
        private ElementButton _system_icon_button;
        private ElementStatic _title_caption;
        private ElementButton _title_menu_button;
        private IUnifiedMessageBox _unifiedMessageBox;
        private bool ChangeOnScreenSaverFlag;
        private volatile bool ChannelEventAttached;
        public const string CN_AccountManager = "UserAccountManager";
        public const string CN_AdBar = "AdBar";
        public const string CN_ChannelManager = "ChannelManager";
        public const string CN_ConnectionManager = "ConnectionManager";
        public const string CN_ContactManager = "ContactManager";
        public const string CN_ConversationManager = "ConversationManager";
        public const string CN_HistoryManager = "HistoryManager";
        public const string CN_ImportExportManager = "ImportExportManager";
        public const string CN_IVRManager = "IVRManager";
        public const string CN_Logger = "Logger";
        public const string CN_MessageHistoryManager = "MessageHistoryManager";
        public const string CN_OptionsManager = "OptionsManager";
        public const string CN_PersonalGroupManager = "PersonalGroupManager";
        public const string CN_UnifiedMessageBox = "UnifiedMessageBox";
        private IContainer components;
        private BDisplayPersonalMessage ctlMoodPhrase;
        private BDisplayNameAndOnlineStatus ctlNickname;
        private HandleRef CurHandleRef;
        private const string DefaultLoggerArgs = @"Folder=%AppData%\Fetion\Log;Type=1;HisLen=9;Threshold=10;Category=11001";
        private const int HotKeyBossId = 1;
        private const int HotKeyId = 0;
        private bool isActiving;
        private Imps.Client.Utils.sensmon.sensmon.sens_simple_notify_proc_type m_sens_lock_proc;
        private menu_widget menuMain;
        private ToolStripMenuItem miOperation;
        private ToolStripMenuItem miSignOut;
        private ToolStripMenuItem miToolsOptions;
        private Panel panel1;
        private Panel panel2;
        private const int ShowAdHeight = 400;
        private const int ShowUserInfoHeight = 300;
        private AutoResetEvent SuspendAre;
        private System.Windows.Forms.Timer timerMain;
        private NotifyIcon trayIcon;
        private static readonly int[] UserError;
        private int WM_FETIONSTARTED;
        private int WM_TASKBARCREATED;

        public event EventHandler BeginSuspend;

        public event PositionEventHandler HideAdvChanel;

        public event EventHandler MainWindowLoaded;

        public event EventHandler SuspendRestored;

        static MainForm()
        {
            int[] numArray = new int[3];
            numArray[1] = 0x579;
            numArray[2] = 0x57c;
            UserError = numArray;
        }

        public MainForm() : this(new string[0])
        {
        }

        public MainForm(string[] args)
        {
            this._syncObjSensor = new object();
            this.WM_FETIONSTARTED = (int) Imps.Client.Utils.Win32.NativeMethods.RegisterWindowMessage("FetionStarted");
            CallMe.InitCallMe(this);
            CallMeHelper.WM_FETION_CALLME = (int) Imps.Client.Utils.Win32.NativeMethods.RegisterWindowMessage("FetionCallMeMessage");
            if (this.TryCheckSingleton())
            {
                CallMeHelper.TrySendCallMeMessage(args, base.Handle);
                Environment.Exit(0);
            }
            else
            {
                if (this.ExistFetionInstance())
                {
                    if (CallMeHelper.TrySendCallMeMessage(args, base.Handle))
                    {
                        Environment.Exit(0);
                        return;
                    }
                }
                else if (args.Length >= 1)
                {
                    foreach (string text in args)
                    {
                        if (CallMe.ParseCallMeParams(text) == 0)
                        {
                            break;
                        }
                    }
                }
                try
                {
                    this.HandleExceptions();
                    this.InitLogger();
                    this.ParseArgs(args);
                    this.InitializeComponent();
                    this.trayIcon.Icon = ImpsTrayIcons.OffLine;
                    base.Icon = ImpsIcons.Logo;
                    FuncDispatcher.SetMainWindow(this);
                    this.BuildMainMenu();
                    this.InitUiComponents();
                    this.InitMainUIForm(this);
                    this.trayIcon.Visible = true;
                    this.DoLocalization();
                    this.RearrangeUiElements();
                    this.TryLoadWindowsSetting(this);
                    if (!this.CurrentUser.Configuration.UserSetting.MainWindowSetting.AutoPopup)
                    {
                        base.WindowState = FormWindowState.Minimized;
                        if (UserAccounts.LatestAccountAutoLogin)
                        {
                            base.ShowInTaskbar = false;
                        }
                    }
                    ImpsHelp.HelpPage = Imps.Client.Core.FixedClientSetting.Instance.HelpPage;
                    this.CurHandleRef = new HandleRef(this, base.Handle);
                    this.RegWndMsg();
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.Message);
                    ShellHelper.ApplicationExit();
                }
            }
        }

        private void _portrait_button_EnterOrLeave(object sender, EventArgs e)
        {
            GlobalTimer.Register(new EventHandler(this.UserTipTimer_Tick), this, 5);
        }

        public void _portrait_dropdown_buttons_SwitchOff(object sender, EventArgs e)
        {
            this._main_form.PortraitDropDownMenu.Close();
        }

        public void _portrait_dropdown_buttons_SwitchOn(object sender, EventArgs e)
        {
            System.Drawing.Point point = base.PointToScreen(new System.Drawing.Point(this._portrait_button._location.X, this._portrait_dropdown_buttons._location.Y + this._portrait_dropdown_buttons._size.Height));
            this._main_form.PortraitDropDownMenu.Show(point, 3);
        }

        private void ActiveFriendTab()
        {
            this._chanel_buttons.get_Item(0).Down = true;
            this.Chanel_ButtonDown(this._chanel_buttons.get_Item(0), EventArgs.Empty);
            this.friend_click(this._chanel_buttons.get_Item(0), EventArgs.Empty);
        }

        public void ActiveMainWindow()
        {
            if (!BossKey.Hidden && !this.isActiving)
            {
                this.isActiving = true;
                try
                {
                    base.Visible = true;
                    bool showInTaskbar = base.ShowInTaskbar;
                    base.ShowInTaskbar = true;
                    if (!showInTaskbar)
                    {
                        this.TryLoadHotKey();
                    }
                    if (base.WindowState == FormWindowState.Minimized)
                    {
                        base.WindowState = FormWindowState.Normal;
                    }
                    ControlHelper.RepositionFormOnScreenSizeChanged(this);
                    base.Activate();
                    Imps.Client.Utils.Win32.NativeMethods.BringWindowToTop(base.Handle);
                    Imps.Client.Utils.Win32.NativeMethods.ShowWindow(base.Handle, 9);
                    IPresenceSensor sensor = this.CurrentUser.Presence.IndexOfSensor("MouseKeyboardSensor");
                    if (sensor != null)
                    {

⌨️ 快捷键说明

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