private void DeviceAddedEvent(object sender, DeviceAddedEventArgs e) { if (e.Device.IsSetBusylightSupported) { _availableDevices.Add(e.Device); } }
void ConnectModel_DeviceAdded(object sender, DeviceAddedEventArgs e) { // add webcam if (e.Info.WebCameraInfo != null) { var createdCamera = new WebCameraEngine(e.Info.WebCameraInfo); AddCamera(createdCamera); //CurrentModel = createdCamera; } else if (e.Info.IpCameraInfo != null) { // add IP camera if (e.Info.IpCameraInfo.Uri == null) { return; } var ipCamera = new IpCameraEngine(e.Info.IpCameraInfo.Uri.ToString(), UserName, Password); if (CurrentModel != null && CurrentModel.CameraInfo.Equals(ipCamera.CameraInfo)) { CurrentModel = null; } AddCamera(ipCamera); // CurrentModel = ipCamera; } }
/// <summary> /// Raises the DeviceAdded event. /// </summary> /// <param name="e">The event arguments.</param> protected virtual void OnDeviceAdded(DeviceAddedEventArgs e) { if (DeviceAdded != null) { DeviceAdded.GetInvocationList().InvokeEventGUIThreadSafe(this, e); } }
void insteon_DeviceAdded(object sender, DeviceAddedEventArgs args) { DeviceId id = args.Device.Address; DeviceReference reference = new DeviceReference(id.ToString(), PluginName); BasicDevice device = callbacks.Devices.FindDevice(reference); if (device != null) { InsteonDeviceData deviceData = (InsteonDeviceData)device.AutomationData; } else { InsteonDeviceData deviceData = new InsteonDeviceData(args.Device.Category, args.Device.Subcategory); if (args.Device is DimmingLight) { DimmingLight dimmer = (DimmingLight)args.Device; FroggyPlugin.Devices.PercentLevelDevice basic = new FroggyPlugin.Devices.PercentLevelDevice(); basic.Address = reference; basic.Name = args.Device.DeviceName; basic.Level = dimmer.OnLevel * 100 / 255; basic.AutomationData = deviceData; callbacks.Devices.AddDevice(basic); } else if (args.Device is OnOffDevice) { OnOffDevice onOffDevice = (OnOffDevice)args.Device; FroggyPlugin.Devices.OnOffDevice basic = new FroggyPlugin.Devices.OnOffDevice(); basic.Address = reference; basic.Name = args.Device.DeviceName; basic.On = onOffDevice.OnLevel != 0; basic.AutomationData = deviceData; callbacks.Devices.AddDevice(basic); } } }
static void insteon_DeviceAdded(object sender, DeviceAddedEventArgs args) { if (args.Device is OnOffDevice) { OnOffDevice dimmer = (OnOffDevice)args.Device; log.InfoFormat("{0} OnLevel {1}", dimmer.DeviceName, dimmer.OnLevel); } }
private void OnJabraDeviceAdded(object sender, DeviceAddedEventArgs deviceAddedEventArgs) { Action action = () => { AddJabraDevice(deviceAddedEventArgs.Device); }; workQueue.Add(action); }
async void HandleDeviceAdded(object aObj, DeviceAddedEventArgs aArgs) { _device = aArgs.Device; await _client.StopScanningAsync(); Device.BeginInvokeOnMainThread(() => { btnVibrate.IsEnabled = true; }); }
public void OnDeviceAdded(object aObj, DeviceAddedEventArgs aArgs) { Dispatcher.Invoke(() => { try { DevicesList.Add(new CheckedListItem(aArgs.Device)); } catch (Exception ex) { // Ignore already added devices } }); }
void Indi_DeviceAdded(Object sender, DeviceAddedEventArgs e) { try { if (IsHandleCreated) { this.Invoke((MethodInvoker) delegate { Device.Items.Add(e.Device.Name); Device.SelectedIndex = 0; }); } } catch { } }
private void ClientOnDeviceAdded(object sender, DeviceAddedEventArgs e) { if (Devices.TryGetValue(e.Device.Index, out var dev)) { if (!dev.Name.Equals(e.Device.Name, StringComparison.Ordinal)) { Devices.Remove(e.Device.Index); Devices.Add(e.Device.Index, new ButtplugPanelDevice(e.Device)); return; } dev.Device = e.Device; dev.IsConnected = true; } else { Devices.Add(e.Device.Index, new ButtplugPanelDevice(e.Device)); } }
/// <summary> /// Handles the DeviceAdded event. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="e">The event arguments.</param> private void mdDiscovery_DeviceAdded(object sender, DeviceAddedEventArgs e) { DeviceFound(e, true); }
/// <summary> /// Raises the DeviceAdded event. /// </summary> /// <param name="e">The event arguments.</param> protected virtual void OnDeviceAdded(DeviceAddedEventArgs e) { if (DeviceAdded != null) DeviceAdded.GetInvocationList().InvokeEventGUIThreadSafe(this, e); }
/// <summary> /// Raises events for when a new device is found. /// </summary> /// <param name="e">The event arguments containing the device information for the device that was found.</param> /// <param name="foundRoot">True if the device came from the discovery, false if it came from child devices.</param> protected void DeviceFound(DeviceAddedEventArgs e, bool foundRoot) { if (foundRoot || mdfoDeviceFindOption == Components.DeviceFindOption.AllChildrenDeivces) OnDeviceAdded(e); if (msfoServiceFindOption != ServiceFindOption.None) { if (msfoServiceFindOption == ServiceFindOption.AllDeviceChildrenServices || msfoServiceFindOption == ServiceFindOption.AllSearchURIMatchesServiceTypeId || (foundRoot || mdfoDeviceFindOption == DeviceFindOption.AllChildrenDeivces)) try { foreach (UPNPLib.IUPnPService lsService in e.COMDevice.Services) { if ( ( msfoServiceFindOption != ServiceFindOption.AllSearchURIMatchesServiceTypeId && msfoServiceFindOption != ServiceFindOption.FoundDeviceDirectChildrenOnlySearchURIMatchesServiceTypeId ) || lsService.ServiceTypeIdentifier == msSearchUri) OnServiceAdded(new ServiceAddedEventArgs(e, lsService)); } } catch (Exception loE) { if (Logging.Enabled) Logging.Log( this, string.Format("Exception occurred while enumerating Services: {0}", loE.ToString())); } } if (mdfoDeviceFindOption == DeviceFindOption.AllChildrenDeivces || msfoServiceFindOption == ServiceFindOption.AllDeviceChildrenServices || msfoServiceFindOption == ServiceFindOption.AllSearchURIMatchesServiceTypeId) try { foreach (UPNPLib.IUPnPDevice ldCOMDevice in e.COMDevice.Children) DeviceFound(new DeviceAddedEventArgs(ldCOMDevice, e), false); } catch (Exception loE) { if (Logging.Enabled) Logging.Log( this, string.Format("Exception occurred while enumerating Devices: {0}", loE.ToString())); } }
private static void clientDeviceAdded(object sender, DeviceAddedEventArgs args) { Log_Manager.write($"Device ${args.Device.Name} connected"); }
private void Client_DeviceAdded(object sender, DeviceAddedEventArgs deviceEventArgs) { AddDevice(deviceEventArgs.Device); }
// Now we scan for devices. Since we didn't add any Subtype Managers yet, this will go // out and find them for us. They'll be reported in the logs as they are found. // // We'll scan for devices, and print any time we find one. void HandleDeviceAdded(object aObj, DeviceAddedEventArgs aArgs) { PublishLogs($"Device connected: {aArgs.Device.Name}"); }
/// <summary> /// Occurs when the UPnPDiscovery component finds a new device. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="a">The event arguments.</param> private void UPnP_DeviceAdded(object sender, DeviceAddedEventArgs a) { // Notify user WriteLine(String.Format("Device Found '{0}' - {1} - {2}", a.Device.FriendlyName, a.Device.UniqueDeviceName, a.Device.Type)); }
static void OnDeviceAdded(object o, DeviceAddedEventArgs args) { Console.WriteLine($"Device ${args.Device.Name} connected"); }
private void clientDeviceAdded(object sender, DeviceAddedEventArgs args) { Log_Manager.write($"Device ${args.Device.Name} connected"); remote.buzz(50); }
private async void DeviceFound(object sender, DeviceAddedEventArgs e) { await client.StopScanningAsync(); }
private void OnDeviceAttached(object sender, DeviceAddedEventArgs e) { AddNewDevice(e.Device); }
static void HandleDeviceAdded(object aObj, DeviceAddedEventArgs aArgs) { Console.Out.WriteLine($"Device connected: {aArgs.Device.Name}"); }
private void AddDevice(object sender, DeviceAddedEventArgs e) { Log($"Device {e.Device.Name} Connected!"); Devices.Add(e.Device); UpdateDevices(); }
void mdDiscovery_DeviceAdded(object sender, DeviceAddedEventArgs e) { QuickDevices.Add((ManagedUPnP.Device)e.Device); Devices.Add((ManagedUPnP.Device)e.Device); treeUpdateRequired = true; }
/// <summary> /// Raises events for when a new device is found. /// </summary> /// <param name="e">The event arguments containing the device information for the device that was found.</param> /// <param name="foundRoot">True if the device came from the discovery, false if it came from child devices.</param> protected void DeviceFound(DeviceAddedEventArgs e, bool foundRoot) { if (foundRoot || mdfoDeviceFindOption == Components.DeviceFindOption.AllChildrenDeivces) { OnDeviceAdded(e); } if (msfoServiceFindOption != ServiceFindOption.None) { if (msfoServiceFindOption == ServiceFindOption.AllDeviceChildrenServices || msfoServiceFindOption == ServiceFindOption.AllSearchURIMatchesServiceTypeId || (foundRoot || mdfoDeviceFindOption == DeviceFindOption.AllChildrenDeivces)) { try { foreach (UPNPLib.IUPnPService lsService in e.COMDevice.Services) { if ( ( msfoServiceFindOption != ServiceFindOption.AllSearchURIMatchesServiceTypeId && msfoServiceFindOption != ServiceFindOption.FoundDeviceDirectChildrenOnlySearchURIMatchesServiceTypeId ) || lsService.ServiceTypeIdentifier == msSearchUri) { OnServiceAdded(new ServiceAddedEventArgs(e, lsService)); } } } catch (Exception loE) { if (Logging.Enabled) { Logging.Log( this, string.Format("Exception occurred while enumerating Services: {0}", loE.ToString())); } } } } if (mdfoDeviceFindOption == DeviceFindOption.AllChildrenDeivces || msfoServiceFindOption == ServiceFindOption.AllDeviceChildrenServices || msfoServiceFindOption == ServiceFindOption.AllSearchURIMatchesServiceTypeId) { try { foreach (UPNPLib.IUPnPDevice ldCOMDevice in e.COMDevice.Children) { DeviceFound(new DeviceAddedEventArgs(ldCOMDevice, e), false); } } catch (Exception loE) { if (Logging.Enabled) { Logging.Log( this, string.Format("Exception occurred while enumerating Devices: {0}", loE.ToString())); } } } }