private void BriaPhoneRemoteControl_Load(object sender, EventArgs e) { // Use delegates to handle events to ensure GUI updates happen on the Main Thread onConnectedDelegate = new OnConnectedDelegate(MainThread_OnConnected); onErrorDelegate = new OnErrorDelegate(MainThread_OnError); onDisconnectedDelegate = new OnDisconnectedDelegate(MainThread_OnDisconnected); onPhoneStatusDelegate = new OnPhoneStatusDelegate(MainThread_OnPhoneStatus); onCallStatusDelegate = new OnCallStatusDelegate(MainThread_OnCallStatus); onCallOptionsStatusDelegate = new OnCallOptionsStatusDelegate(MainThread_OnCallOptionsStatus); onAudioPropertiesStatusDelegate = new OnAudioPropertiesStatusDelegate(MainThread_OnAudioPropertiesStatus); onMissedCallsStatusDelegate = new OnMissedCallsStatusDelegate(MainThread_OnMissedCallsStatus); onVoiceMailStatusDelegate = new OnVoiceMailStatusDelegate(MainThread_OnVoiceMailStatus); onCallHistoryStatusDelegate = new OnCallHistoryStatusDelegate(MainThread_OnCallHistoryStatus); onSystemSettingsStatusDelegate = new OnSystemSettingsStatusDelegate(MainThread_OnSystemSettingsStatus); onErrorReceivedDelegate = new OnErrorReceivedDelegate(MainThread_OnErrorReceived); briaAPI.OnStatusChanged += new EventHandler <BriaAPI.StatusChangedEventArgs>(OnStatusChanged); briaAPI.OnPhoneStatus += new EventHandler <BriaAPI.PhoneStatusEventArgs>(OnPhoneStatus); briaAPI.OnCallStatus += new EventHandler <BriaAPI.CallStatusEventArgs>(OnCallStatus); briaAPI.OnCallOptionsStatus += new EventHandler <BriaAPI.CallOptionsStatusEventArgs>(OnCallOptionsStatus); briaAPI.OnAudioPropertiesStatus += new EventHandler <BriaAPI.AudioPropertiesStatusEventArgs>(OnAudioPropertiesStatus); briaAPI.OnMissedCallsStatus += new EventHandler <BriaAPI.MissedCallsStatusEventArgs>(OnMissedCallsStatus); briaAPI.OnVoiceMailStatus += new EventHandler <BriaAPI.VoiceMailStatusEventArgs>(OnVoiceMailStatus); briaAPI.OnCallHistoryStatus += new EventHandler <BriaAPI.CallHistoryStatusEventArgs>(OnCallHistoryStatus); briaAPI.OnSystemSettingsStatus += new EventHandler <BriaAPI.SystemSettingsStatusEventArgs>(OnSystemSettingsStatus); briaAPI.OnErrorReceived += new EventHandler <BriaAPI.ErrorReceivedEventArgs>(OnErrorReceived); briaAPI.OnError += new EventHandler(OnError); briaAPI.OnDisconnected += new EventHandler(OnDisconnected); briaAPI.OnConnected += new EventHandler(OnConnected); ConnectToBria(); }
public NetClient( OnConnectedDelegate onConnectedCallback, OnDisconnectedDelegate onDisconnectedCallback, OnReceivedDelegate onReceivedCallback) { this.onConnectedCallback = onConnectedCallback; this.onDisconnectedCallback = onDisconnectedCallback; this.onReceivedCallback = onReceivedCallback; handle = NetClient_Create(OnConnected, OnDisconnected, OnReceived); netClient = this; }
protected static extern void RegisterOnDisconnectedDelegate(OnDisconnectedDelegate callback);
/// <summary> /// Is called to subscribe a method to on disconnected event. /// </summary> /// <param name="callback">Method to subscribe.</param> public void SubscribeToOnDisconnectedEvent(OnDisconnectedDelegate callback) { onDisconnectedEvent += callback; }
private static extern IntPtr NetClient_Create( OnConnectedDelegate onConnected, OnDisconnectedDelegate onDisconnected, OnReceivedInnerDelegate onReceivedInner);