private void UIChanging(byte status) { // return; Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate { switch (status) { case USRSTRUCTS.STATUS_CALL_RINGING: btnsatate.RedialBtn = (Style)Application.Current.FindResource("btnRedial_off"); btn_redial.IsEnabled = false; btnsatate.PullBtn = (Style)Application.Current.FindResource("btnCallPull_off"); btn_callpull.IsEnabled = false; callstate = CALL_STATES.RING; break; case USRSTRUCTS.STATUS_CALL_CONNECTED: btnsatate.TransferBtn = (Style)Application.Current.FindResource("btnCallPush_down"); btn_callpush.IsEnabled = true; btnsatate.RecordBtn = (Style)Application.Current.FindResource("btnREC_down"); btnRecord.IsEnabled = true; btnCall.IsEnabled = false; callstate = CALL_STATES.CONNECTED; break; case USRSTRUCTS.STATUS_CALL_TERMINATED: if (!string.IsNullOrEmpty(lastcallnumber)) { btnsatate.RedialBtn = (Style)Application.Current.FindResource("btnRedial_down"); btn_redial.IsEnabled = true; } btnsatate.PullBtn = (Style)Application.Current.FindResource("btnCallPull_down"); btn_callpull.IsEnabled = true; btnsatate.TransferBtn = (Style)Application.Current.FindResource("btnCallPush_off"); btn_callpush.IsEnabled = false; btnsatate.RecordBtn = (Style)Application.Current.FindResource("btnREC_off"); btnRecord.IsEnabled = false; btnCall.IsEnabled = true; btnCall.Content = "☎"; btnCall.ToolTip = "Call"; curCall = null; callstate = CALL_STATES.NONE; IsTransfer = false; IsHold = false; break; } })); }
private void UIChanging(byte status) { // return; Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate { switch (status) { case USRSTRUCTS.STATUS_CALL_RINGING: btnsatate.RedialBtn = (Style)Application.Current.FindResource("btnRedial_off"); btn_redial.IsEnabled = false; btnsatate.PullBtn = (Style)Application.Current.FindResource("btnCallPull_off"); btn_callpull.IsEnabled = false; callstate = CALL_STATES.RING; break; case USRSTRUCTS.STATUS_CALL_CONNECTED: btnsatate.TransferBtn = (Style)Application.Current.FindResource("btnCallPush_down"); btn_callpush.IsEnabled = true; btnsatate.RecordBtn = (Style)Application.Current.FindResource("btnREC_down"); btnRecord.IsEnabled = true; btnCall.IsEnabled = false; callstate = CALL_STATES.CONNECTED; break; case USRSTRUCTS.STATUS_CALL_TERMINATED: if (!string.IsNullOrEmpty(lastcallnumber)) { btnsatate.RedialBtn = (Style)Application.Current.FindResource("btnRedial_down"); btn_redial.IsEnabled = true; } btnsatate.PullBtn = (Style)Application.Current.FindResource("btnCallPull_down"); btn_callpull.IsEnabled = true; btnsatate.TransferBtn = (Style)Application.Current.FindResource("btnCallPush_off"); btn_callpush.IsEnabled = false; btnsatate.RecordBtn = (Style)Application.Current.FindResource("btnREC_off"); btnRecord.IsEnabled = false; btnCall.IsEnabled = true; btnCall.Content = "☎"; btnCall.ToolTip = "Call"; curCall = null; callstate = CALL_STATES.NONE; IsTransfer = false; IsHold = false; break; } })); }