lextendo
15th September 2009, 10:54 PM
My goal is this: I have an external database with (company-) contacts as a SQLCE database. Since there are over 1000+ contacts in that database, I don't like the idea to 'load' all of them in my outlook. So when there's an incoming call I check if it is an outlook contact, if not I like to search the external database (by phone number) and create a contact 'on the fly' (NOT to be stored in poutlook!)
I 'detect' a new incoming call like this:
private SystemState _phoneIncomingCall = new SystemState(SystemProperty.PhoneIncomingCall);
_phoneIncomingCall.Changed += OnPhoneIncomingCallChanged;
This works like a charm. In the OnPhoneIncomingCallChanged method I check if the (new SystemState(SystemProperty.PhoneIncomingCallerCont act)).CurrentValue is null. This too is working :cool: Now I would like to 'alter' the PhoneIncomingCallerContact with a contact I lookup in the other database using the incoming number. I imagine I should create a new contact and 'rethrow' the PhoneIncomingCallerContact.
The "OnPhoneIncomingCallerContact" function in the dialer should be triggered and the 'altered' contact information displayed.
Key question: can I create a SystemState(SystemProperty.PhoneIncomingCallerCont act) "State and Notifications Broker" message?
And off course if so: how to do it in C#?
Another approach might be to 'unhook' the default phone application, get the incoming call and 'hook' the phone application back when I decide to take the call or reject the call?
Again: Is it possible and how to do it in C#?
Your help is appreciated...
I 'detect' a new incoming call like this:
private SystemState _phoneIncomingCall = new SystemState(SystemProperty.PhoneIncomingCall);
_phoneIncomingCall.Changed += OnPhoneIncomingCallChanged;
This works like a charm. In the OnPhoneIncomingCallChanged method I check if the (new SystemState(SystemProperty.PhoneIncomingCallerCont act)).CurrentValue is null. This too is working :cool: Now I would like to 'alter' the PhoneIncomingCallerContact with a contact I lookup in the other database using the incoming number. I imagine I should create a new contact and 'rethrow' the PhoneIncomingCallerContact.
The "OnPhoneIncomingCallerContact" function in the dialer should be triggered and the 'altered' contact information displayed.
Key question: can I create a SystemState(SystemProperty.PhoneIncomingCallerCont act) "State and Notifications Broker" message?
And off course if so: how to do it in C#?
Another approach might be to 'unhook' the default phone application, get the incoming call and 'hook' the phone application back when I decide to take the call or reject the call?
Again: Is it possible and how to do it in C#?
Your help is appreciated...