Hi, there~
i'm writing an application which's used to record the *CallTalking*
time.
Here 's a piece of my code:
public void ListenCall()
{
callState = new
SystemState(SystemProperty.PhoneCallTalking);
callCount = new
SystemState(SystemProperty.PhoneActiveCallCount);
callState.Changed += new
ChangeEventHandler(callState_Changed);
callCount.Changed += new
ChangeEventHandler(callCount_Changed);
}
void callCount_Changed(object sender, ChangeEventArgs args)
{
if (args.NewValue != null && (int)args.NewValue == 1)
MessageBox.Show("Call Incoming...");
//**********
//if i removed or replaced the "MessageBox.Show(..).",
//the callState.Changed would never be triggled
//BUG?!
//**********
}
void callState_Changed(object sender, ChangeEventArgs args)
{
if (args.NewValue != null)
{
String state = ((int)args.NewValue) == 1 ?
"talking..." : "hang up";
MessageBox.Show(state);
}
}
Any suggestion about that?
Thanks in advance~
Regards,