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

📄 useraccountmanager.cs

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

        private void miSignInOrSignOut_Click(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                if ((!this.LoginOrLogout() && (this.CurrentUser.Status != UserAccountStatus.Logon)) && ((this.CurrentUser.Status != UserAccountStatus.OfflineLogon) && !((Form) this._frameworkWnd).Focused))
                {
                    long id;
                    string password;
                    this._frameworkWnd.ActiveMainWindow();
                    this._entryControl.CheckInput(out id, out password);
                }
            });
        }

        private void miSignOut_Click(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                bool cancel = false;
                this.Logout(ref cancel);
            });
        }

        private void miSubscribeVodafoneFederation_Click(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                RegisterIPIDialog form = new RegisterIPIDialog(this._frameworkWnd);
                if (ControlHelper.ShowDialogCenterOnParent(form, this._frameworkWnd.MainWindow, true) == DialogResult.OK)
                {
                    AsyncBizOperation op = new AsyncBizOperation();
                    op.Successed += new EventHandler(this.opSubscribeVodafone_Successed);
                    this.CurrentUser.AsyncSubscribeService("VodafoneFederation", op);
                }
            });
        }

        private void miToolsOptions_Click(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                this._frameworkWnd.ShowOptions("SsGeneral");
            });
        }

        private void miUnsubscribe_Click(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                UnRegisterDialog form = new UnRegisterDialog(this._frameworkWnd);
                if (ControlHelper.ShowDialogCenterOnParent(form, this._frameworkWnd.MainWindow, true) == DialogResult.OK)
                {
                    AsyncBizOperation op = new AsyncBizOperation();
                    op.Successed += new EventHandler(this.opUnsubscribe_Successed);
                    this.CurrentUser.AsyncUnregister(op);
                }
            });
        }

        private void miUnsubscribeVodafoneFederation_Click(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                UnRegisterIPIDialog form = new UnRegisterIPIDialog(this._frameworkWnd);
                if (ControlHelper.ShowDialogCenterOnParent(form, this._frameworkWnd.MainWindow, true) == DialogResult.OK)
                {
                    AsyncBizOperation op = new AsyncBizOperation();
                    op.Successed += new EventHandler(this.opUnsubscribeVodafone_Successed);
                    this.CurrentUser.AsyncUnsubscribeService("VodafoneFederation", op);
                }
            });
        }

        private void miUser_DropDownOpening(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                if (this.CurrentUser.Status == UserAccountStatus.Logon)
                {
                    this._menuItemsUser[0].set_Enabled(true);
                    this._menuItemsUser[1].set_Enabled(true);
                    this._menuItemsUser[2].set_Enabled(true);
                }
                else if (this.CurrentUser.Status == UserAccountStatus.OfflineLogon)
                {
                    this._menuItemsUser[0].set_Enabled(true);
                    this._menuItemsUser[1].set_Enabled(true);
                    this._menuItemsUser[2].set_Enabled(false);
                }
            });
        }

        private void notifyWnd_Click(object sender, EventArgs e)
        {
            try
            {
                ((SystemInfoNotify) sender).Close();
                this._frameworkWnd.ActiveMainWindow();
            }
            catch
            {
            }
        }

        internal void OnStatusMenuOpening(object sender, CancelEventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                this.DoPresenceMenuItemsOpening(((ToolStrip) sender).get_Items());
            });
        }

        private void opSubscribeVodafone_Successed(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                this._frameworkWnd.UnifiedMessageBox.ShowInfo(this._frameworkWnd.MainWindow, StringTable.User.MsgSubscribeVodafoneSuccess);
            });
        }

        private void opUnsubscribe_Successed(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                this._frameworkWnd.UnifiedMessageBox.ShowInfo(this._frameworkWnd.MainWindow, StringTable.User.MsgUnsubscribedSuccess);
            });
        }

        private void opUnsubscribeVodafone_Successed(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                this._frameworkWnd.UnifiedMessageBox.ShowInfo(this._frameworkWnd.MainWindow, StringTable.User.MsgUnsubscribeVodafoneSuccess);
            });
        }

        private void RecentBuddies_DropDownOpening(object sender, EventArgs e)
        {
            try
            {
                ((ToolStripMenuItem) sender).get_DropDownItems().Clear();
                ((ToolStripMenuItem) sender).get_DropDownItems().AddRange(this.GetRecentBuddiesMenuItems());
            }
            catch
            {
            }
        }

        public void Register()
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                if ((this._provsionWizard == null) || this._provsionWizard.IsDisposed)
                {
                    this._provsionWizard = new ProvisionWizard(this.FrameworkWnd);
                    this._provsionWizard.CurrentMobileNo = this._entryControl.CurrentId;
                }
                this._provsionWizard.ShowWizard(this._frameworkWnd.MainWindow);
            });
        }

        public void SubscribeOrUnSubscribeServiceEventHandler(object sender, EventArgs e)
        {
            TagedToolStripMenuItem item = sender as TagedToolStripMenuItem;
            if ((item != null) && this.CurrentUser.SubscribedServices.ContainsKey(item.Tag))
            {
                if (this.CurrentUser.SubscribedServices.get_Item(item.Tag).Subscribed)
                {
                    ExServiceMananger.GetTagService(this.CurrentUser, item.Tag).UnSubscribe(this._frameworkWnd);
                }
                else
                {
                    ExServiceMananger.GetTagService(this.CurrentUser, item.Tag).Subscribe(this._frameworkWnd);
                }
            }
        }

        public void Unregister()
        {
        }

        private void UserStatusChangedOnlineOfflineSwitch(object sender, UserSatusChangedEventArgs e)
        {
            if (e.NewStatus == UserAccountStatus.Logoff)
            {
                do
                {
                    this.CurrentUser.StatusChanged -= new EventHandler<UserSatusChangedEventArgs>(this, (IntPtr) this.UserStatusChangedOnlineOfflineSwitch);
                }
                while (Interlocked.Decrement(ref this.statusChangedEventCount) > 0);
                this.statusChangedEventCount = 0;
                this.CurrentUser.Password = this.switchPassword;
                this.CurrentUser.AsyncLogin(this._switchTarget, false);
            }
        }

        public Imps.Client.Core.User CurrentUser
        {
            get
            {
                return this._currentUser;
            }
        }

        public UserAccountStatus CurrentUserStatus
        {
            get
            {
                if (this._currentUser != null)
                {
                    return this._currentUser.Status;
                }
                return UserAccountStatus.None;
            }
        }

        public Control EntryPointControl
        {
            get
            {
                return this._entryControl;
            }
        }

        internal IFrameworkWindow FrameworkWnd
        {
            get
            {
                return this._frameworkWnd;
            }
        }

        internal OfflineMsgSettingForm InnerOfflineMsgForm
        {
            get
            {
                if ((this._offlineMsgForm == null) || this._offlineMsgForm.IsDisposed)
                {
                    this._offlineMsgForm = new OfflineMsgSettingForm();
                }
                return this._offlineMsgForm;
            }
        }

        internal bool IsLogon
        {
            get
            {
                return (this.CurrentUserStatus == UserAccountStatus.Logon);
            }
        }

        public ToolStripItem[] OperationMenuItems
        {
            get
            {
                this.BuildOperationMenuItems();
                return this._menuItemsOperation;
            }
        }

        public ContextMenuStrip TrayIconMenu
        {
            get
            {
                this.BuildTrayIconMenu();
                return this._miTrayIcon;
            }
        }

        public Control UserInfoControl
        {
            get
            {
                if (this._userInfoControl == null)
                {
                    this._userInfoControl = new BUserInfoControl(this);
                }
                return this._userInfoControl;
            }
        }

        public ToolStripItem UserMenuItem
        {
            get
            {
                this.BuildUserMenuItems();
                return this._miUser;
            }
        }
    }
}

⌨️ 快捷键说明

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