private void OnServiceConnected(object sender, PviEventArgs e) { if (sender is BR.AN.PviServices.Service service) { ServiceConnected?.Invoke(sender, e); } }
public void OnServiceConnected(ComponentName name, IBinder binder) { _binder = binder as AndroidSensusServiceBinder; if (_binder != null) { ServiceConnected?.Invoke(this, new AndroidServiceConnectedEventArgs(_binder)); } }
public void OnServiceConnected(ComponentName name, IBinder service) { printerService = PosPrinterServiceStub.AsInterface(service); if (printerService != null) { ServiceConnected?.Invoke(null, this); } }
public void OnServiceConnected(ComponentName name, IBinder binder) { Console.WriteLine($"MyServiceConnection.OnServiceConnected : {binder.GetType().Name}"); if (binder is MyServiceBinder serviceBinder) { Binder = serviceBinder; Binder.IsBound = true; ServiceConnected?.Invoke(this, new ServiceConnectedEventArgs(binder)); } }
public static bool InitializeBluetooth(string deviceName) { BluetoothDevice device = BluetoothAdapter.DefaultAdapter.BondedDevices.Where(x => x.Name == deviceName).SingleOrDefault(); if (device == null) { return(false); } BluetoothSocket socket = device.CreateRfcommSocketToServiceRecord(Java.Util.UUID.FromString("00001101-0000-1000-8000-00805F9B34FB")); socket.Connect(); ServiceConnected?.Invoke(null, new JicaiQ2ThermalPrinterBluetooth(new BluetoothSocketAdapter(socket))); return(true); }
public async void OnServiceConnected(ComponentName?name, IBinder?service) { if (!(service is LiveGeolocationServiceBinder serviceBinder)) { return; } Binder = serviceBinder; Binder.IsBound = true; // raise the service bound event ServiceConnected?.Invoke(this, new ServiceConnectedEventArgs { Binder = service }); // begin updating the location in the Service await serviceBinder.Service.StartLocationUpdates(); }
/// <summary> /// adds a service to the collection /// </summary> /// <param name="type">type of service</param> /// <param name="module">module handling service calls</param> public void AddService(string type, IStreamServiceModule module) { services[type] = module; module.Connected += () => { Logger.Info(this, $"{type} connected"); ServiceConnected?.Invoke(type); }; module.NewFollower += information => { Logger.Info(this, $"New follower '{information.Username}' on {type}."); if (ValidUser(information.Service, information.Username)) { NewFollower?.Invoke(information); } }; module.NewSubscriber += AddSubscriber; if (module is IStreamStatsModule) { ((IStreamStatsModule)module).ViewersChanged += OnViewersChanged; } }
public void OnServiceConnected(ComponentName name, IBinder service) { var serviceBinder = service as GeofencingServiceBinder; if (serviceBinder == null) { return; } Binder = serviceBinder; Binder.IsBound = true; // raise the service bound event ServiceConnected?.Invoke(this, new ServiceConnectedEventArgs { Binder = service }); // begin updating the location in the Service serviceBinder.Service.StartGeofencingUpdates(); }
private void OnMarketDataConnectedEventHandler(object sender, EventArgs args) { ServiceConnected?.Invoke(this, new TerminalServiceEventArgs(TerminalService.MarketData)); }
private void OnExchangeConnectedEventHandler(object sender, EventArgs args) { ServiceConnected?.Invoke(this, new TerminalServiceEventArgs(TerminalService.Exchange)); }
public void OnServiceConnected([GeneratedEnum] ProfileType profile, IBluetoothProfile proxy) => ServiceConnected?.Invoke(this, EventArgs.Empty);
public void OnServiceConnected(ComponentName name, IBinder service) { ServiceConnected?.Invoke(name, service); }