public WinTwoDail(WinLync Lync)
        {
            InitializeComponent();
            this.Lync = Lync;
            this.Closed += new EventHandler(WinTwoDail_Closed);
            WinLync.lyncCounter++;
            imgNum1.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum1.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum2.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum2.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum3.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum3.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum4.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum4.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum5.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum5.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum6.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum6.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum7.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum7.MouseLeave += new MouseEventHandler(img_MouseLeave);

            imgNum8.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum8.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum9.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum9.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum0.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum0.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNumS.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNumS.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNumX.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNumX.MouseLeave += new MouseEventHandler(img_MouseLeave);

            this.txtNumber.Focus();
        }
        public WinOptionSetting(WinLync lync)
        {
            this.lync = lync;
            InitializeComponent();
            tabOptionSetting.TabStripPlacement = Dock.Left;

            WinOptionSettingViewModel model = new WinOptionSettingViewModel(this);
            this.DataContext = model;
            model.StartLoadData();
            this.Closed += new EventHandler(WinOptionSetting_Closed);
            isHave = true;
            WinLync.lyncCounter++;
        }
        public WinHisitory(WinLync Lync)
        {
            this.Lync = Lync;
            InitializeComponent();
            dateTimeFrom.SelectedDate = DateTime.Now.AddDays(-10);
            dateTimeTo.SelectedDate = DateTime.Now.AddDays(1);
            model = new WinHistoryViewModel(this);
            this.DataContext = model;
            WinLync.lyncCounter++;
            this.Closed += new EventHandler(WinHisitory_Closed);

            this.Title = StringHelper.FindLanguageResource("Hisitory");
            isHave = true;
        }
        public WinAllContact(WinLync lync, bool isBlindTransCall = false)
        {
            InitializeComponent();
            this.isBlindTransCall = isBlindTransCall;

            //是查询两百条数据
            GetAllLyncContacts("",0);
            try
            {
                for (int i = 0; i < dtContact.Rows.Count; i++)//对数据按名称进行排序
                {
                    string iName = dtContact.Rows[i][0].ToString();
                    for (int j = i + 1; j < dtContact.Rows.Count; j++)
                    {
                        string jName = dtContact.Rows[j][0].ToString();
                        if (iName.CompareTo(jName) == 1)
                        {
                            object[] temp = new object[3];
                            temp = dtContact.Rows[j].ItemArray;
                            dtContact.Rows[j].ItemArray= dtContact.Rows[i].ItemArray;
                            dtContact.Rows[i].ItemArray = temp;
                            iName = jName;
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                LogManager.SystemLog.Error(ex.ToString());
            }
            dtSource = dtContact.Copy();
            //如果为空,则重按定位第一页按钮   2015/7/29
            if (dtSource.Rows.Count == 0)
            {
                txtPage.Text = "1";
                string str = "";
                GetPageLyncContacts(str, Convert.ToInt32(txtPage.Text) - 1);
                dtSource = dtContact.Copy();
                this.listContact.DataContext = dtContact;
            }
            else
            {
                this.listContact.DataContext = dtContact;
            }
            WinLync.lyncCounter++;
            this.lync = lync;
            this.Closed += new EventHandler(WinAllContact_Closed);
            this.txtInput.Focus();//是输入文本获取焦点
        }
        public WinCallReceive(WinLync lync, string name, bool isVide)
        {
            InitializeComponent();
            btnFinish.Visibility = Visibility.Hidden;
            imgOtherPhone.Visibility = Visibility.Hidden;
            txtOtherPhone.Visibility = Visibility.Hidden;
            callName = name;
            model = new WinCallReceiveViewModel(this, isVide);
            this.lync = lync;
            this.DataContext = model;
            this.Title = StringHelper.GetSubString(name);
            isvideo = isVide;
            if (isVide)
            {
                this.Height = 120;
            }
            else
            {
                imgType.Visibility = Visibility.Collapsed;
            }
            if (lync.isConnected == true)   //语音升级视频后再转移,此时expander不可见,espace无此种转移
            {
                this.expander.Visibility = Visibility.Hidden;
                //modify by 00327190  2015/7/27   语音升级视频时,未接受请求时,本地的视频升级按钮,加人按钮,呼叫保持按钮不能使用
                lync.winCall.btnVideo.IsEnabled = false;
                lync.winCall.btnAddContact.IsEnabled = false;
                lync.winCall.btnCallSuspend.IsEnabled = false;

            }
            WinLync.lyncCounter++;
            this.Left = SystemParameters.WorkArea.Width - this.Width;
            this.Top = SystemParameters.WorkArea.Height - this.Height;
            this.Closing += new System.ComponentModel.CancelEventHandler(WinCallReceive_Closing);
            this.Closed += new EventHandler((sender, e)
                =>
            {
                WinLync.lyncCounter--;
            });
            GetPhone();   //2015/7/28
            lync.isHave = true;
        }
Exemplo n.º 6
0
        public WinDail(WinLync Lync)
        {
            InitializeComponent();
            this.Lync = Lync;
            this.Closed += new EventHandler(WinDail_Closed);
            WinLync.lyncCounter++;
            imgNum1.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum1.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum2.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum2.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum3.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum3.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum4.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum4.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum5.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum5.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum6.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum6.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum7.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum7.MouseLeave += new MouseEventHandler(img_MouseLeave);

            imgNum8.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum8.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum9.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum9.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNum0.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNum0.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNumS.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNumS.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgNumX.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgNumX.MouseLeave += new MouseEventHandler(img_MouseLeave);

            imgCall.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgCall.MouseLeave += new MouseEventHandler(img_MouseLeave);
            imgBack.MouseEnter += new MouseEventHandler(img_MouseEnter);
            imgBack.MouseLeave += new MouseEventHandler(img_MouseLeave);

            this.Title = StringHelper.FindLanguageResource("Keypad");
            this.txtNumber.Focus();
        }
Exemplo n.º 7
0
        public FrmToolBar(WinLync lync)
        {
            InitializeComponent();
            phoneJointEventCB = new PhoneJointEventCB(PhoneJointEventCBMethod);
            this.Visible = false;
            this.TopMost = true;
            SetButtonVisible(false);

            BtnHisitory.FlatAppearance.BorderSize = 0;
            BtnHisitory.FlatStyle = FlatStyle.Flat;
            BtnSetting.FlatAppearance.BorderSize = 0;
            BtnSetting.FlatStyle = FlatStyle.Flat;
            BtnDail.FlatAppearance.BorderSize = 0;
            BtnDail.FlatStyle = FlatStyle.Flat;
            BtnIP.FlatAppearance.BorderSize = 0;
            BtnIP.FlatStyle = FlatStyle.Flat;
            BtnPC.FlatAppearance.BorderSize = 0;
            BtnPC.FlatStyle = FlatStyle.Flat;
            BtnFWD.FlatAppearance.BorderSize = 0;
            BtnFWD.FlatStyle = FlatStyle.Flat;
            BtnMail.FlatAppearance.BorderSize = 0;
            BtnMail.FlatStyle = FlatStyle.Flat;
            BtnDail.Click += new EventHandler(BtnDail_Click);
            BtnHisitory.Click += new EventHandler(BtnHisitory_Click);
            BtnSetting.Click += new EventHandler(BtnSetting_Click);
            BtnIP.Click += new EventHandler(BtnIP_Click);
            BtnPC.Click += new EventHandler(BtnPC_Click);
            BtnFWD.Click += new EventHandler(BtnFWD_Click);
            BtnMail.Click += new EventHandler(BtnMail_Click);
            LabState.MouseEnter += new EventHandler(LabState_MouseEnter);
            LabState.MouseLeave += new EventHandler(LabState_MouseLeave);
            this.Lync = lync;
            labState.TabIndex = 1;
            labState.Focus();
            toolBarWiewModel = new AddInToolBarWiewModel(this);
        }
        public WinCallViewModel(WinCall window, string str)
        {
            try
            {
                //if (SingletonObj.LoginInfo.LyncName != str.Split(';')[0] && str.Split(';').Length != 1)
                //{
                //    this.flag = false;
                //}
                //else
                //{
                //    this.flag = true;
                //}
                //StrTemp = winlync.strTempBool.ToString();
                callBackConfMemberEventCB = new ConfMemberEventCB(callBackConfMemberEventCBProcess);
                callBackVideoCallEventCB = new CallEventCB(callBackVideoCallEventCBProcess);
                callReservedEventCB = new CallReservedEventCB(callReservedEventCBProcess);
                callTransEventCB = new CallTransEventCB(callTransEventCBProcess);
                //modify by jinyeqing 2015/5/22   jiaji 说要把这三个事件回调函数放之前  (上下顺序倒了一下  下面的注释了)
                call.SetConfMemEventCallBack(callBackConfMemberEventCB);

                call.SetVideoCallEventCallBack(callBackVideoCallEventCB);

                call.SetCallReservedEventCallBack(callReservedEventCB);

                call.SetCallTransEventCallBack(callTransEventCB);
                //modify by jinyeqing 2015/5/22   jiaji 说要把这三个事件回调函数放之前  (上下顺序倒了一下  下面的注释了)
                winCall = window;

                VideoCommand = new DelegateCommand(VideoCommandProcess);
                CallSuspendCommand = new DelegateCommand(CallSuspendCommandProcess);
                HoldDownCommand = new DelegateCommand(HoldDownCommandProcess);
                SetMicPhoneCommand = new DelegateCommand(SetMicPhoneCommandProcess);
                AddContactCommand = new DelegateCommand(AddContactCommandProcess);

                HoldDownOneCommand = new DelegateCommand(HoldDownOneCommandProcess);
                ReInviteOneCommand = new DelegateCommand(ReInviteOneCommandProcess);

                MuteCommand = new DelegateCommand(MuteCommandProcess);
                RemoveCommand = new DelegateCommand(RemoveCommandProcess);
                OpenDialCommand = new DelegateCommand(OpenDialCommandProcess);
                SetVolCommand = new DelegateCommand(SetVolCommandProcess);
                BlindTransCallCommand = new DelegateCommand(BlindTransCallCommandProcess);
                this.winlync = winCall.lync;   //modify by 00327190 2015/7/16
                try
                {

                    lock (WinCall.lockObject)
                    {

                        try
                        {
                            LogManager.SystemLog.Info("WinCallViewModel Monitor.Enter");
                            contactList = new List<UCContact>();

                            string[] listStr = str.Split(';');
                            foreach (string con in listStr)
                            {
                                if (str.IndexOf("VideoCall") > -1 && contactList.Count == 2)
                                {
                                    break;
                                }
                                if (con == "VideoCall")
                                {
                                    IsVideo = true;
                                    continue;
                                }
                                UCContact uc = new UCContact();
                                uc.UserName = con;

                                if (contactList.Exists(x => x.UserName == uc.UserName))
                                {
                                    continue;
                                }

                                if (uc.UserName.IndexOf("@") != -1)
                                {
                                    uc.UCMemberType = MemberType.UC_ACCOUNT;
                                }
                                else  //如果是纯数字,则再分能不能查到对应的UC用户  2015/9/21
                                {
                                    StringBuilder ucName = new StringBuilder(100);
                                    call.GetUCAccountByPhoneNo(uc.UserName, ucName);
                                    if (ucName.ToString() == "")  //纯话机   2015/9/21
                                    {
                                        uc.UCMemberType = MemberType.UC_IPPHONE;
                                    }
                                    else
                                    {
                                        uc.UCMemberType = MemberType.UC_ACCOUNT;
                                        uc.UserName = ucName + StringHelper.GetLyncDomainString(SingletonObj.LoginInfo.LyncName);
                                    }
                                    //uc.UCMemberType = MemberType.UC_IPPHONE;
                                }
                                if (contactList.Count == 0)
                                {
                                    if (IsVideo)
                                    {
                                        //2015/8/24    UTF8 转码UNICODE
                                        //byte[] buffer1 = Encoding.Default.GetBytes(str);
                                        //byte[] buffer2 = Encoding.Convert(Encoding.UTF8, Encoding.Default, buffer1, 0, buffer1.Length);
                                        //string strBuffer = Encoding.Default.GetString(buffer2, 0, buffer2.Length);
                                        winCall.Title = (uc.UserName == SingletonObj.LoginInfo.LyncName ? str.Split(';')[2].ToString() : uc.UserName);
                                    }
                                    else
                                    {
                                        //2015/8/24    UTF8 转码UNICODE
                                        //byte[] buffer1 = Encoding.Default.GetBytes(str);
                                        //byte[] buffer2 = Encoding.Convert(Encoding.UTF8, Encoding.Default, buffer1, 0, buffer1.Length);
                                        //string strBuffer = Encoding.Default.GetString(buffer2, 0, buffer2.Length);
                                        winCall.Title = (uc.UserName == SingletonObj.LoginInfo.LyncName ? str.Split(';')[1].ToString() : uc.UserName);
                                    }
                                    uc.IsLeader = true;
                                    uc.Mute = MemStatusInCall.CONF_MEM_INCONF;
                                }
                                else
                                {
                                    uc.Mute = MemStatusInCall.CONF_MEM_INVITING;
                                }
                                uc.Online = GetContactAvailability((int)uc.UCMemberType, StringHelper.GetSubString(uc.UserName));
                                contactList.Add(uc);
                            }

                            bool isConf = false;
                            if (contactList.Count > 2)
                            {
                                isConf = true;
                                StrTemp = isConf;
                            }
                            winCall.Render(contactList, isConf);
                        }
                        finally
                        {
                            LogManager.SystemLog.Info("WinCallViewModel Monitor.Exit");
                        }
                        //call.SetConfMemEventCallBack(callBackConfMemberEventCB);

                        //call.SetVideoCallEventCallBack(callBackVideoCallEventCB);

                        //call.SetCallReservedEventCallBack(callReservedEventCB);
                    }

                }
                catch (System.Exception ex)
                {
                    LogManager.SystemLog.Error(ex.ToString());
                }
            }
            catch (System.Exception ex)
            {
                LogManager.SystemLog.Error(ex.ToString());
            }
        }