public void SetBtnImage(int devType) { type = (PhoneJointType)devType; if (type == PhoneJointType.IPPhone_Device) { string str = System.Windows.Forms.Application.StartupPath; BtnPC.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PC_2.png"); BtnIP.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PHONE_1.png"); } else { string str = System.Windows.Forms.Application.StartupPath; BtnPC.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PC_1.png"); BtnIP.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PHONE_2.png"); } }
void PhoneJointEventCBMethod(ref PJStatusParam _pj) { LogManager.SystemLog.Debug(Enum.GetName(typeof(EM_PhoneJointStatusType), _pj.PJ_Status)); string user = _pj.ucCalleeAcc; EM_PhoneJointStatusType stateType = (EM_PhoneJointStatusType)_pj.PJ_Status; if (stateType == EM_PhoneJointStatusType.STATUS_START_SUCC && type != PhoneJointType.IPPhone_Device) { string str = System.Windows.Forms.Application.StartupPath; BtnPC.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PC_2.png"); BtnIP.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PHONE_3.png"); type = PhoneJointType.IPPhone_Device; if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null) { return; } System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { Dialog.Show(StringHelper.FindLanguageResource("StatusStartSucess"), StringHelper.FindLanguageResource("Success")); })); } else if (stateType == EM_PhoneJointStatusType.STATUS_STOP_SUCC && type != PhoneJointType.PC_Device) { type = PhoneJointType.PC_Device; string str = System.Windows.Forms.Application.StartupPath; BtnPC.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PC_3.png"); BtnIP.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PHONE_2.png"); if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null) { return; } System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { Dialog.Show(StringHelper.FindLanguageResource("StatusStopSucess"), StringHelper.FindLanguageResource("Success")); })); } else if (stateType == EM_PhoneJointStatusType.STATUS_START_FAILED && type != PhoneJointType.IPPhone_Device) //2015/8/6 && 后面是新加的 { //modify by 00327190 2015/7/13 设置话机联动失败时也应该将图片置为相应的状态 string str = System.Windows.Forms.Application.StartupPath; BtnPC.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PC_3.png"); BtnIP.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PHONE_2.png"); if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null) { return; } System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { Dialog.Show(StringHelper.FindLanguageResource("StatusStartFailed"), StringHelper.FindLanguageResource("error")); })); } else if (stateType == EM_PhoneJointStatusType.STATUS_STOP_FAILED && type != PhoneJointType.PC_Device) //2015/8/6 && 后面是新加的 { if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null) { return; } System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { Dialog.Show(StringHelper.FindLanguageResource("StatusStopFailed"), StringHelper.FindLanguageResource("error")); })); } //modify by 00327190 2015/7/30 话机注销上报消息 else if (stateType == EM_PhoneJointStatusType.STATUS_OFFLINE) { type = PhoneJointType.PC_Device; string str = System.Windows.Forms.Application.StartupPath; BtnPC.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PC_3.png"); BtnIP.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PHONE_2.png"); if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null) { return; } System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { Dialog.Show(StringHelper.FindLanguageResource("StatusOffline"), StringHelper.FindLanguageResource("StatusOffline")); })); } //modify by 00327190 2015/7/30 话机上线上报消息 else if (stateType == EM_PhoneJointStatusType.STATUS_ONLINE && type == PhoneJointType.IPPhone_Device) //9/17 { type = PhoneJointType.PC_Device; string str = System.Windows.Forms.Application.StartupPath; BtnPC.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PC_2.png"); BtnIP.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PHONE_3.png"); if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null) { return; } System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { Dialog.Show(StringHelper.FindLanguageResource("Statusonline"), StringHelper.FindLanguageResource("Statusonline")); })); } }
void PhoneJointEventCBMethod(ref PJStatusParam _pj) { LogManager.SystemLog.Debug(Enum.GetName(typeof(EM_PhoneJointStatusType), _pj.PJ_Status)); string user = _pj.ucCalleeAcc; EM_PhoneJointStatusType stateType = (EM_PhoneJointStatusType)_pj.PJ_Status; if (stateType == EM_PhoneJointStatusType.STATUS_START_SUCC && type != PhoneJointType.IPPhone_Device) { string str = System.Windows.Forms.Application.StartupPath; BtnPC.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PC_2.png"); BtnIP.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PHONE_3.png"); type = PhoneJointType.IPPhone_Device; if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null) { return; } System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { Dialog.Show(StringHelper.FindLanguageResource("StatusStartSucess"), StringHelper.FindLanguageResource("Success")); })); } else if (stateType == EM_PhoneJointStatusType.STATUS_STOP_SUCC && type != PhoneJointType.PC_Device) { type = PhoneJointType.PC_Device; string str = System.Windows.Forms.Application.StartupPath; BtnPC.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PC_3.png"); BtnIP.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PHONE_2.png"); if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null) { return; } System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { Dialog.Show(StringHelper.FindLanguageResource("StatusStopSucess"), StringHelper.FindLanguageResource("Success")); })); } else if (stateType == EM_PhoneJointStatusType.STATUS_START_FAILED && type != PhoneJointType.IPPhone_Device) //2015/8/6 && 后面是新加的 { //modify by 00327190 2015/7/13 设置话机联动失败时也应该将图片置为相应的状态 string str = System.Windows.Forms.Application.StartupPath; BtnPC.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PC_3.png"); BtnIP.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PHONE_2.png"); if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null) { return; } System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { Dialog.Show(StringHelper.FindLanguageResource("StatusStartFailed"), StringHelper.FindLanguageResource("error")); })); } else if (stateType == EM_PhoneJointStatusType.STATUS_STOP_FAILED && type != PhoneJointType.PC_Device) //2015/8/6 && 后面是新加的 { if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null) { return; } System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { Dialog.Show(StringHelper.FindLanguageResource("StatusStopFailed"), StringHelper.FindLanguageResource("error")); })); } //modify by 00327190 2015/7/30 话机注销上报消息 else if (stateType == EM_PhoneJointStatusType.STATUS_OFFLINE) { type = PhoneJointType.PC_Device; string str = System.Windows.Forms.Application.StartupPath; BtnPC.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PC_3.png"); BtnIP.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PHONE_2.png"); if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null) { return; } System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { Dialog.Show(StringHelper.FindLanguageResource("StatusOffline"), StringHelper.FindLanguageResource("StatusOffline")); })); } //modify by 00327190 2015/7/30 话机上线上报消息 else if (stateType == EM_PhoneJointStatusType.STATUS_ONLINE && type == PhoneJointType.IPPhone_Device) //9/17 { type = PhoneJointType.PC_Device; string str = System.Windows.Forms.Application.StartupPath; BtnPC.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PC_2.png"); BtnIP.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PHONE_3.png"); if (SingletonObj.LoginInfo == null || SingletonObj.LoginInfo.UserID == null) { return; } System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { Dialog.Show(StringHelper.FindLanguageResource("Statusonline"), StringHelper.FindLanguageResource("Statusonline")); })); } }
public void SetBtnImage(int devType) { type = (PhoneJointType)devType; if (type == PhoneJointType.IPPhone_Device) { string str = System.Windows.Forms.Application.StartupPath; BtnPC.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PC_2.png"); BtnIP.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PHONE_1.png"); } else { string str = System.Windows.Forms.Application.StartupPath; BtnPC.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PC_1.png"); BtnIP.Image = Image.FromFile(str.Substring(0, str.IndexOf("bin")) + "\\Image\\PHONE_2.png"); } }