Пример #1
0
        /// <summary>
        /// 当前应用程序关闭时,注销该用户
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void Current_Exit(object sender, ExitEventArgs e)
        {
            try
            {
                if (this.loginWindow != null)
                {
                    this.loginWindow.Close();
                }
                //设置DNS
                NetWorkAdapter.SetNetworkAdapter(Constant.RouteIp);
                //退出lync辅助
                LyncHelper.LyncSignOut(new Action(() =>
                {
                    if (LyncHelper.MainConversation != null)
                    {
                        ModelManage.ConferenceLyncConversation.RemoveConversation(Constant.ConferenceName, new Action <bool>((successed) =>
                        {
                        }));
                        //设置DNS
                        //NetWorkAdapter.EnableDHCP2();

                        //Conference.View.Tree.ConferenceTreeView.TittleEditControlTimer.Stop();
                        //Conference.View.IMM.ConferenceAudio_View.TittleEditControlTimer.Stop();

                        //LyncClient.GetAutomation().EndMeetNow(null);
                        LyncHelper.MainConversation.Close();
                    }
                }));
                //系统关闭辅助
                Current_Exit_Help();
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(typeof(App), ex);
            }
            finally
            {
                //关闭指定后台进程
                ProcessManage.KillProcess("Lync");
                //lync临时显示
                WindowHide.SetTrayIconAllDsiplay("Lync");
                //消除死亡托盘图标
                SysTray.Refresh();
            }
        }