Exemplo n.º 1
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public MainWindow()
        {
            try
            {
                //加载UI
                InitializeComponent();

                //绑定当前上下文
                this.DataContext = this;

                #region 控件绑定

                //自我绑定
                MainWindow.mainWindow = this;
                //主页绑定
                MainWindow.MainPageInstance = this.mainPage;
                //首页绑定
                MainWindow.IndexInstance = this.index;

                #endregion

                #region 事件注册

                //退出
                this.btnExit.Click += btnExit_Click;
                //首页子项选择事件
                this.index.IndexItemSelected += index_IndexItemSelected;
                //主窗体关闭事件
                this.Closed += MainWindow_Closed;
                //弹出软键盘
                this.btnkeyBoard.Click += btnkeyBoard_Click;
                //刷新
                this.btnReflesh.Click += btnReflesh_Click;
                //通讯修复
                //this.btnCommunicationRepair.Click += btnCommunicationRepair_Click;
                //返回高级菜单
                this.btnBack.Click += btnBack_Click;
                //状态更改
                this.StateChanged += MainWindow_StateChanged;

                this.ChangedToDesk.Click += ChangedToDesk_Click;

                #endregion

                //获取automation
                Constant.lyncAutomation = LyncClient.GetAutomation();
                //时间显示
                TimerDisplayManage.TimerDisplay(this.txtNowTime);
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void Parameter_Init()
        {
            try
            {
                Constant.lyncClient = LyncClient.GetClient();

                //获取automation
                Constant.lyncAutomation = LyncClient.GetAutomation();

                //时间显示
                TimerDisplayManage.TimerDisplay(this.txtNowTime);
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }