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

📄 useraccountmanager.cs

📁 飞信的收发使用csharp进行开发
💻 CS
📖 第 1 页 / 共 3 页
字号:
        private void miMyStatus_DropDownOpening(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                this.DoPresenceMenuItemsOpening(((ToolStripMenuItem) sender).DropDownItems);
            });
        }

        private void miNotBySms_Click(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                OfflineMsgSettingForm form = this.InnerOfflineMsgForm;
                innerOfflineMsgForm.HoursNotBySms = (int) this.CurrentUser.Presence.SmsStatus.OriginalValue.TotalHours;
                if (innerOfflineMsgForm.Visible)
                {
                    innerOfflineMsgForm.BringToFront();
                    innerOfflineMsgForm.Activate();
                }
                else if (ControlHelper.ShowDialogCenterOnParent(innerOfflineMsgForm, this._frameworkWnd.MainWindow) == DialogResult.OK)
                {
                    this.InnerChangeSmsStatus(new TimeSpan(this._offlineMsgForm.HoursNotBySms, 0, 0));
                }
            });
        }

        private void miPresence_Click(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                ToolStripMenuItem item1 = (ToolStripMenuItem) sender;
                if (item1.Tag is CustomPresence)
                {
                    CustomPresence tag = (CustomPresence) item1.Tag;
                    if ((this.CurrentUser.Presence.MainPresence != tag.BasicPresence) || (this.CurrentUser.Presence.Text != tag.Desccription))
                    {
                        this.ChangePresence(tag.BasicPresence, tag.Desccription);
                    }
                }
            });
        }

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

        private void miProvisioning_Click(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                this.Register();
            });
        }

        private void miShowMain_Click(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                this._frameworkWnd.ActiveMainWindow();
            });
        }

        private void miSignIn_Click(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                if ((!this.Login() && (this.CurrentUser.Status != UserAccountStatus.Logon)) && !((Form) this._frameworkWnd).Focused)
                {
                    long num;
                    string str;
                    this._frameworkWnd.ActiveMainWindow();
                    this._entryControl.CheckInput(out num, out str);
                }
            });
        }

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

        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 dialog = new RegisterIPIDialog(this._frameworkWnd);
                if (dialog.ShowDialog(this._frameworkWnd.MainWindow) == 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(string.Empty);
            });
        }

        private void miUnsubscribe_Click(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                UnRegisterDialog dialog = new UnRegisterDialog(this._frameworkWnd);
                if (dialog.ShowDialog(this._frameworkWnd.MainWindow) == DialogResult.OK)
                {
                    this.CurrentUser.AsyncUnregister(null);
                }
            });
        }

        private void miUnsubscribeVodafoneFederation_Click(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                UnRegisterIPIDialog dialog = new UnRegisterIPIDialog(this._frameworkWnd);
                if (dialog.ShowDialog(this._frameworkWnd.MainWindow) == 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 {
                bool flag = this.CurrentUser.Status == UserAccountStatus.Logon;
                bool flag2 = (((this.CurrentUser.Status != UserAccountStatus.Logon) && (this.CurrentUser.Status != UserAccountStatus.Loginning)) && (this.CurrentUser.Status != UserAccountStatus.WaitReconnect)) && (this.CurrentUser.Status != UserAccountStatus.Disconnected);
                this._menuItemsUser[0].Enabled = flag2;
                this._menuItemsUser[1].Enabled = flag2;
                this._menuItemsUser[2].Enabled = flag;
                this._menuItemsUser[4].Enabled = flag;
                this._menuItemsUser[5].Enabled = flag;
                this._menuItemsUser[6].Enabled = flag;
            });
        }

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

        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 opUnsubscribeVodafone_Successed(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
                this._frameworkWnd.UnifiedMessageBox.ShowInfo(this._frameworkWnd.MainWindow, StringTable.User.MsgUnsubscribeVodafoneSuccess);
            });
        }

        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 as Form);
            });
        }

        private void Sensor_Tick(object sender, EventArgs e)
        {
            if ((this._sensorMouseKey != null) && this._sensorMouseKey.ShouldHideMainWindows())
            {
                this._frameworkWnd.MainWindow.Visible = false;
            }
        }

        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[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()
        {
        }

        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 + -