static void deviceProvider_DeviceFound(object sender, DeviceInfoEventArgs e) { IDeviceProvider deviceProvider = (IDeviceProvider)sender; Console.WriteLine("A device has been found."); IDeviceInfo foundDeviceInfo = e.DeviceInfo; IDevice device = deviceProvider.Connect(foundDeviceInfo); Console.WriteLine("Connected to the device."); device.Disconnected += device_Disconnected; if (device is IWiimote) { IWiimote wiimote = (IWiimote)device; Console.WriteLine("We have connected to a Wiimote device."); // Here we have access to all the operations that we can perform on a Wiimote. OnWiimoteConnected(wiimote); } // If we don't want to be connected to the device, we can disconnect like this: device.Disconnect(); }
public ConnectionChannelHandlerAdapter(ILogger logger, IDeviceProvider deviceProvider, ITcpServiceEntryProvider tcpServiceEntryProvider, TcpServerProperties tcpServerProperties) { _logger = logger; _deviceProvider = deviceProvider; _tcpServiceEntryProvider = tcpServiceEntryProvider; _tcpServerProperties = tcpServerProperties; }
public DeploymentViewModel(IDeviceProvider deviceProvider, IWindowsOptionsProvider optionsProvider, IWoaDeployer deployer, UIServices uiServices, AdvancedViewModel advancedViewModel, WimPickViewModel wimPickViewModel, ILowLevelApi lowLevelApi) { this.optionsProvider = optionsProvider; this.deployer = deployer; this.uiServices = uiServices; this.advancedViewModel = advancedViewModel; this.wimPickViewModel = wimPickViewModel; var isSelectedWim = wimPickViewModel.WhenAnyObservable(x => x.WimMetadata.SelectedImageObs) .Select(metadata => metadata != null); FullInstallWrapper = new CommandWrapper <Unit, Unit>(this, ReactiveCommand.CreateFromTask(Deploy, isSelectedWim), uiServices.Dialog); IsBusyObservable = FullInstallWrapper.Command.IsExecuting; isBusy = IsBusyObservable.ToProperty(this, model => model.IsBusy); RefreshDisksCommandWrapper = new CommandWrapper <Unit, ICollection <Disk> >(this, ReactiveCommand.CreateFromTask(lowLevelApi.GetDisks), uiServices.Dialog); disks = RefreshDisksCommandWrapper.Command .Select(x => x.Select(disk => new DiskViewModel(disk))) .ToProperty(this, x => x.Disks); this.WhenAnyValue(x => x.SelectedDisk).Where(x => x != null).Subscribe(x => deviceProvider.Device = new RaspberryPi(lowLevelApi, x.Disk)); }
private void _deviceProvider_RoomStructureChanged(IDeviceProvider obj) { _updatingGroupedDevices = true; RaisePropertyChanged("GroupedDevices"); _updatingGroupedDevices = false; SelectedDevicesChanged(this, _deviceProvider.SelectedDevices); }
public AdvancedViewModel(ISettingsService settingsService, IFileSystemOperations fileSystemOperations, UIServices uiServices, IProviderBasedWindowsDeployer deployer, IDiskLayoutPreparer preparer, IWindowsOptionsProvider optionsProvider, IDeviceProvider deviceProvider, IDownloadProgress progress, StatusViewModel statusViewModel, IPhone phone) { StatusViewModel = statusViewModel; this.settingsService = settingsService; this.uiServices = uiServices; this.deployer = deployer; this.preparer = preparer; this.optionsProvider = optionsProvider; this.deviceProvider = deviceProvider; this.progress = progress; this.phone = phone; sizeReservedForWindows = this.WhenAnyValue(x => x.GbsReservedForWindows, ByteSize.FromGigaBytes) .ToProperty(this, x => x.SizeReservedForWindows); DeleteDownloadedWrapper = new CommandWrapper <Unit, Unit>(this, ReactiveCommand.CreateFromTask(() => DeleteDownloaded(fileSystemOperations)), uiServices.Dialog); ForceDualBootWrapper = new CommandWrapper <Unit, Unit>(this, ReactiveCommand.CreateFromTask(ForceDualBoot), uiServices.Dialog); ForceDisableDualBootWrapper = new CommandWrapper <Unit, Unit>(this, ReactiveCommand.CreateFromTask(ForceDisableDualBoot), uiServices.Dialog); BackupCommandWrapper = new CommandWrapper <Unit, Unit>(this, ReactiveCommand.CreateFromTask(Backup), uiServices.Dialog); RestoreCommandWrapper = new CommandWrapper <Unit, Unit>(this, ReactiveCommand.CreateFromTask(Restore), uiServices.Dialog); IsBusyObservable = Observable.Merge(new [] { DeleteDownloadedWrapper.Command.IsExecuting, BackupCommandWrapper.Command.IsExecuting, RestoreCommandWrapper.Command.IsExecuting, ForceDualBootWrapper.Command.IsExecuting, ForceDisableDualBootWrapper.Command.IsExecuting, }); }
public DeployWindows(IDeviceProvider deviceProvider, IDiskLayoutPreparer preparer, IProviderBasedWindowsDeployer providerBasedWindowsDeployer, IDownloadProgress progressObserver) { this.deviceProvider = deviceProvider; this.preparer = preparer; this.providerBasedWindowsDeployer = providerBasedWindowsDeployer; this.progressObserver = progressObserver; }
/// <summary> /// /// </summary> /// <param name="device">The hardware abstraction to use</param> protected SITScanner(IDeviceProvider device, ushort pid) : base(null) { // Register self device.StartSectionFilter(pid, new FilterHandler(OnData), m_FilterData, m_FilterMask); // Remember m_Device = device; PID = pid; }
public CategorySelectorViewModel(IDeviceProvider deviceProvider, IOverlayProvider overlayProvider) { _deviceProvider = deviceProvider; _leftCategory = _deviceProvider.DeviceCategories.FirstOrDefault((a) => a.Id == "FloorLamp"); _centerCategory = _deviceProvider.DeviceCategories.FirstOrDefault((a) => a.Id == "DeskLamp"); _rightCategory = _deviceProvider.DeviceCategories.FirstOrDefault((a) => a.Id == "HangingLamp"); _overlayProvider = overlayProvider; }
public StorageProvider(IDeviceProvider deviceProvider, IDbConnectionFactory dbConnectionFactory) { this.deviceProvider = deviceProvider; this.dbConnectionFactory = dbConnectionFactory; using (var ctx = dbConnectionFactory.GetConnection()) { //create if not exists ctx.CreateTable <MainTable>(); } }
/// <summary> /// Create a new instance and start EPG parsing on PID <i>0x12</i>. /// </summary> /// <param name="device">Related hardware device.</param> /// <param name="portal">The currently show station.</param> public ServiceParser(IDeviceProvider device, Station portal) { // Remember DVBDevice = device; Portal = portal; // Create EPG parser EPGParser = new Parser(DVBDevice); // Attach handler EPGParser.SectionFound += new Parser.SectionFoundHandler(EPGSectionFound); }
public DiscoverWindow() : base(Gtk.WindowType.Toplevel) { this.Title = "LinuxGUITest"; this.DeleteEvent += new DeleteEventHandler(OnDeleteEvent); this.WindowPosition = Gtk.WindowPosition.Center; _Provider = DeviceProviderRegistry.CreateSupportedDeviceProvider(); _Provider.DeviceFound += new EventHandler <DeviceInfoEventArgs>(DeviceFound); _Provider.DeviceLost += new EventHandler <DeviceInfoEventArgs>(DeviceLost); _UpdateThread = new Thread(new ThreadStart(UpdateFunction)); _UpdateThread.Start(); _HBox = new HBox(true, 0); _HBox.Homogeneous = false; this.Add(_HBox); _HBox.Show(); Gtk.TreeView tree = new Gtk.TreeView(); tree.WidthRequest = 250; tree.HeightRequest = 300; _HBox.PackStart(tree); // new column Gtk.TreeViewColumn devicetypeColumn = new Gtk.TreeViewColumn(); devicetypeColumn.Title = "Type"; Gtk.CellRendererText devicetypeCell = new CellRendererText(); devicetypeColumn.PackStart(devicetypeCell, true); devicetypeColumn.AddAttribute(devicetypeCell, "text", 0); // new column Gtk.TreeViewColumn detailsColumn = new Gtk.TreeViewColumn(); detailsColumn.Title = "Details"; Gtk.CellRendererText detailseCell = new CellRendererText(); detailsColumn.PackStart(detailseCell, true); detailsColumn.AddAttribute(detailseCell, "text", 1); tree.AppendColumn(devicetypeColumn); tree.AppendColumn(detailsColumn); _ListStore = new Gtk.ListStore(typeof(string), typeof(string)); tree.Model = _ListStore; _HBox.ShowAll(); LogLine("Searching for wii devices..."); _Provider.StartDiscovering(); }
public SalePointRootViewModel(ISessionProvider sessionProvider, IDeviceProvider deviceProvider, INotificationsProvider notificationsProvider) { this.deviceProvider = deviceProvider; this.notificationsProvider = notificationsProvider; this.sessionProvider = sessionProvider; this.notificationsProvider.SetAuthHeader(this.sessionProvider.SessionData.access_token); this.notificationsProvider.SetEventHandlers(Roles.salepoint); Task.Run(async() => { await this.notificationsProvider.StarListening(); }); }
public UserInterfaceRenderer(IDeviceProvider provider) { _device = provider.Device; _textures = new List<TextureBatch>(); _vertices = new VertexPositionNormalTexture[16384]; for (int i = 0; i < _vertices.Length; i += 4) { _vertices[i + 0].TextureCoordinate = new Vector2(0, 0); _vertices[i + 1].TextureCoordinate = new Vector2(1, 0); _vertices[i + 2].TextureCoordinate = new Vector2(0, 1); _vertices[i + 3].TextureCoordinate = new Vector2(1, 1); } }
public DiscoverWindow() : base(Gtk.WindowType.Toplevel) { this.Title = "LinuxGUITest"; this.DeleteEvent += new DeleteEventHandler(OnDeleteEvent); this.WindowPosition = Gtk.WindowPosition.Center; _Provider = DeviceProviderRegistry.CreateSupportedDeviceProvider(); _Provider.DeviceFound += new EventHandler<DeviceInfoEventArgs>(DeviceFound); _Provider.DeviceLost += new EventHandler<DeviceInfoEventArgs>(DeviceLost); _UpdateThread = new Thread(new ThreadStart(UpdateFunction)); _UpdateThread.Start(); _HBox = new HBox(true, 0); _HBox.Homogeneous = false; this.Add(_HBox); _HBox.Show(); Gtk.TreeView tree = new Gtk.TreeView(); tree.WidthRequest = 250; tree.HeightRequest = 300; _HBox.PackStart(tree); // new column Gtk.TreeViewColumn devicetypeColumn = new Gtk.TreeViewColumn(); devicetypeColumn.Title = "Type"; Gtk.CellRendererText devicetypeCell = new CellRendererText(); devicetypeColumn.PackStart(devicetypeCell, true); devicetypeColumn.AddAttribute(devicetypeCell, "text", 0); // new column Gtk.TreeViewColumn detailsColumn = new Gtk.TreeViewColumn(); detailsColumn.Title = "Details"; Gtk.CellRendererText detailseCell = new CellRendererText(); detailsColumn.PackStart(detailseCell, true); detailsColumn.AddAttribute(detailseCell, "text", 1); tree.AppendColumn(devicetypeColumn); tree.AppendColumn(detailsColumn); _ListStore = new Gtk.ListStore(typeof(string), typeof(string)); tree.Model = _ListStore; _HBox.ShowAll(); LogLine("Searching for wii devices..."); _Provider.StartDiscovering(); }
public static void Main(string[] args) { // An IDeviceProvider performs the discovering of and connecting to (bluetooth) devices. // An IDeviceInfo holds the information of a discovered device. // Create a DeviceProvider based on the installed software. IDeviceProvider deviceProvider = DeviceProviderRegistry.CreateSupportedDeviceProvider(); deviceProvider.DeviceFound += deviceProvider_DeviceFound; deviceProvider.DeviceLost += deviceProvider_DeviceLost; deviceProvider.StartDiscovering(); Console.WriteLine("The IDeviceProvider is discovering..."); while (true) { Thread.Sleep(1000); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); idleTimer = new System.Windows.Forms.Timer(); idleTimer.Tick += idleTimer_Tick; idleTimer.Interval = 10; idleTimer.Start(); _Provider = DeviceProviderRegistry.CreateSupportedDeviceProvider(); _Provider.DeviceFound += DeviceFound; _Provider.DeviceLost += DeviceLost; _Provider.StartDiscovering(); }
public void Pair(ControlData data) { this.data = data; Console.WriteLine("Starting.."); deviceProvider = DeviceProviderRegistry.CreateSupportedDeviceProvider(); Console.WriteLine("Found provider: " + deviceProvider.ToString()); deviceProvider.DeviceFound += DeviceFound; deviceProvider.DeviceLost += DeviceLost; Console.WriteLine("Discovering device..."); deviceProvider.StartDiscovering(); }
public CarrierMapViewModel(IDeviceProvider deviceProvider, IMvxNavigationService navigationService, ICarrierOrdersService ordersService, IRoutesService routesService, INotificationsProvider notificationsProvider) { this.deviceProvider = deviceProvider; this.navigationService = navigationService; this.ordersService = ordersService; this.routesService = routesService; this.notificationsProvider = notificationsProvider; this.notificationsProvider.SocketStatusUpdated += (sender, value) => RaisePropertyChanged(() => this.SignalrConnectionStatus); this.ordersService.PendingOrdersUpdated += this.PendingOrdersEventHandler; this.routesService.ActiveRouteUpdated += this.ActiveRouteEventHandler; this.sideView = Mvx.IocConstruct <CarrierSideViewViewModel>(); this.floatingOrdersViewModel = Mvx.IocConstruct <CarrierFloatingOrdersViewModel>(); }
private void LoadManualDevice(object sender, EventArgs e) { IDeviceProvider Provider = null; // differentiate between context selection and startup if (sender is ToolStripItem) { ToolStripItem item = (ToolStripItem)sender; Provider = (IDeviceProvider)item.Tag; } if (Provider == null) { return; } Provider.ManualTrigger(); }
static void deviceProvider_DeviceFound(object sender, DeviceInfoEventArgs e) { IDeviceProvider deviceProvider = (IDeviceProvider)sender; Console.WriteLine("A device has been found."); IDeviceInfo foundDeviceInfo = e.DeviceInfo; // Example 2. Connecting to a discovered device. // When you connect to a discovered device, it will result in a IDevice. // IDevice represents the device when connected. Console.WriteLine("Connecting to the device..."); IDevice device = deviceProvider.Connect(foundDeviceInfo); Console.WriteLine("Connected to the device."); // You have connected to the device, // and can now use 'device' to interact with the connected device. // Note that 'device.DeviceInfo' is refering to 'foundDeviceInfo', which we used to connect to the device. // We can use the Disconnected event to stay informed if we can still use the device. device.Disconnected += device_Disconnected; // When the 'device' is an 'IDevice' you can only access properties that are common to // all Devices (Wiimote, BalanceBoard, etc...). // These devices have their own types in WiiDeviceLibrary: IWiimote and IBalanceBoard. Both of these types inherit from IDevice. // To use properties specific to the devices you will have to cast the 'device' to the proper interface. // First we check if the device is the desired type. if (device is IWiimote) { IWiimote wiimote = (IWiimote)device; Console.WriteLine("We have connected to a Wiimote device."); // Here we have access to all the operations that we can perform on a Wiimote. // That's it for connecting to Wii devices. } else if (device is IBalanceBoard) { IBalanceBoard balanceboard = (IBalanceBoard)device; Console.WriteLine("We have connected to a BalanceBoard device."); // Here we have access to all the operations that we can perform on a BalanceBoard. } // If we don't want to be connected to the device, we can disconnect like this: device.Disconnect(); }
public MainViewModel(IStringProvider stringProvider, IDeviceProvider deviceProvider, IContextActionProvider contextActionProvider) { _stringProvider = stringProvider; _deviceProvider = deviceProvider; _contextActionProvider = contextActionProvider; _deviceProvider.SelectedDevicesChanged += _deviceProvider_SelectedDevicesChanged; _deviceProvider.RoomStructureChanged += _deviceProvider_RoomStructureChanged; _groupedDevices = _deviceProvider.Devices.GroupBy( (device) => { return(device.Room); }, (room, devices) => { return(new Devices.DevicesGroup(room, devices)); }).FillEmptyRooms(_deviceProvider.Rooms); }
public int asociarAgente(string idAgente, string extension, string clave) { try { logger.Info("Generación de la interface con el IPCC idAgente:{0} extension:{1}", idAgente, extension); this.device = IDeviceProvider.GetIDevice(EventosHuawei.getMainEvtHuawei(this)) as IDevice; if (this.device == null) { logger.Error("No se obtuvo el acceso a la interface. agentID:{0} extension:{1}", idAgente, extension); return(-1); } logger.Trace("Carga de los datos de telefonista idAgente:{0} extension:{1}", idAgente, extension); AgentInfo agentInfo = new AgentInfo(); agentInfo.AgentId = idAgente; agentInfo.PhoneNumber = extension; agentInfo.PassWord = clave; logger.Trace("Intento de conexión idAgente:{0} extension {1}", idAgente, extension); this.device.Initialize(agentInfo, settings); EventosHuawei.ReceiveInitializeResult += ReceiveInitializeResult; EventosHuawei.ReceiveUnInitializeResult += ReceiveUnInitializeResult; return(0); } catch (Exception ex) { // Se detecto un error en el procedimiento logger.Error("Error en el intento de conexión idAgente:{0} extension:{1} error:{2}", idAgente, extension, ex.Message, ex); return(-1); } }
protected DeviceDemoBase(IDeviceProvider deviceProvider, ILogger logger) { Logger = logger ?? throw new ArgumentNullException(nameof(logger)); DeviceProvider = deviceProvider ?? throw new ArgumentNullException(nameof(deviceProvider)); }
/// <summary> /// Create a new parser instance, /// </summary> /// <param name="device">Set to a DVB hardware abstraction to start /// the filter immediately.</param> public Parser(IDeviceProvider device) { // Start filter if (null != device) StartFilter(device); }
/// <summary> /// Attach to the current EPG PID. /// <see cref="OnData"/> /// </summary> private void StartFilter(IDeviceProvider device) { // Register self device.StartSectionFilter(0x12, new FilterHandler(OnData), FilterData, FilterMask); }
private void _deviceProvider_SelectedDevicesChanged(IDeviceProvider sender, IReadOnlyList <Device> selected) { RaisePropertyChanged("SelectedDevices"); RaisePropertyChanged("ActiveProperties"); SelectedDevicesChanged?.Invoke(this, selected); }
public FilterWheelDemo(IDeviceProvider deviceProvider, ILogger logger) : base(deviceProvider, logger) { }
public ProviderBasedWindowsDeployer(IWindowsOptionsProvider optionsProvider, IDeviceProvider deviceProvider, IWindowsDeployer deployer) { this.optionsProvider = optionsProvider; this.deviceProvider = deviceProvider; this.deployer = deployer; }
public TcpService(IDeviceProvider deviceProvider) { _deviceProvider = deviceProvider; }
/// <summary> /// /// </summary> /// <param name="device">Hardware abstraction to use.</param> public PMTManager(IDeviceProvider device) { // Remember m_Device = device; }
/// <summary> /// Stop the filter. /// </summary> public virtual void Dispose() { // Check mode if (null != m_Device) { // Load IDeviceProvider device = m_Device; // Once m_Device = null; // Try stop device.StopFilter(PID); } }
public ProfileViewModel(IMvxNavigationService navigationService, ISessionProvider sessionProvider, IDeviceProvider deviceProvider, ICarrierOrdersService carrierOrdersService, ISalepointOrdersService salepointOrdersService, IRoutesService routesService, INotificationsProvider notificationsProvider) { this.sessionProvider = sessionProvider; this.navigationService = navigationService; this.deviceProvider = deviceProvider; this.carrierOrdersService = carrierOrdersService; this.salepointOrdersService = salepointOrdersService; this.routesService = routesService; this.notificationsProvider = notificationsProvider; }
public DomeDemo(IDeviceProvider deviceProvider, ILogger logger) : base(deviceProvider, logger) { }
public DualshockReporter(IDeviceProvider deviceProvider) { _deviceProvider = deviceProvider; }
public DeviceManager(ILoggerProvider loggerProvider, IDeviceProvider deviceProvider) { _logger = loggerProvider.CreateLogger <DeviceManager>(); _deviceProvider = deviceProvider; }
public RaspberryPathBuilder(IDeviceProvider deviceProvider) { this.deviceProvider = deviceProvider; }
public int inicializarDatosConexion(string mainIPCC, string backIPCC, int timeOut, string mainIPCCWS, string backIPCCWS, string accessCode1, string accessCode2, string outboundPrefix, string extensionPrefix, int extensionLength, string transferAccessCode, MainForm frm) { try { errMsg = ""; logger.Info("Carga de los valores de conexión."); settings = new Dictionary <string, string>(); settings.Add("HuaweiCTIServerIP", mainIPCC); settings.Add("HuaweiBackupCTIServerIP", backIPCC); settings.Add("HuaweiTimeout", timeOut.ToString()); settings.Add("HuaweiWebServiceUrl", mainIPCCWS); settings.Add("HuaweiBackupWebServiceUrl", backIPCCWS); settings.Add("HuaweiAccessCode1", accessCode1); settings.Add("HuaweiAccessCode2", accessCode2); settings.Add("HuaweiOutboundPrefix", outboundPrefix); settings.Add("HuaweiExtensionPrefix", extensionPrefix); settings.Add("HuaweiExtensionLength", extensionLength.ToString()); settings.Add("HuaweiTransferAccessCode", transferAccessCode); this.timeOut = timeOut; // Inicialización de los valores de status statusAsociacion = false; statusOperacion = OpStatus.Closed; // Se intenta generar la interface de conexión bool nuevo = false; if (this.device == null) { this.device = IDeviceProvider.GetIDevice(EventosHuawei.getMainEvtHuawei(this)) as IDevice; nuevo = true; } if (nuevo) { // Se asocian los eventos con el control EventosHuawei.ReceiveInitializeResult += ReceiveInitializeResult; EventosHuawei.ReceiveUnInitializeResult += ReceiveUnInitializeResult; EventosHuawei.ReceiveSetBusyResult += ReceiveAgentStatusChangeResult; EventosHuawei.ReceiveSetIdleResult += ReceiveAgentStatusChangeResult; EventosHuawei.ReceiveAnswerCallResult += ReceiveAnswerCallResult; EventosHuawei.ReceiveHangUpResult += ReceiveHangUpResult; EventosHuawei.ReceiveAgentStatusChangeResult += ReceiveAgentStatusChange; EventosHuawei.ReceivePhoneAlertingHandle += ReceivePhoneAlerting; EventosHuawei.ReceivePhoneAlertOtherHungupHandler += ReceivePhoneAlertOtherHungup; EventosHuawei.ReceiveInitializeResult += frm.OnInitializeResultCallback; EventosHuawei.ReceiveUnInitializeResult += frm.OnUnInitializeResultCallback; EventosHuawei.ReceiveAgentStatusChangeResult += frm.OnAgentStatusChange; EventosHuawei.ReceivePhoneAlertingHandle += frm.OnPhoneAlerting; EventosHuawei.ReceivePhoneHungupHandler += frm.OnPhoneHungup; } return(0); } catch (Exception ex) { // Se detecto un error en el procedimiento errMsg = string.Format("Error en la carga de los valores de conexión. {0}", ex.Message); logger.Error("Error en la carga de los valores de conexión. {0}", ex.Message, ex); return(-1); } }
public StoreViewModel(IOverlayProvider overlayProvider, IStringProvider stringProvider, IDeviceProvider deviceProvider) { _overlayProvider = overlayProvider; _stringProvider = stringProvider; _deviceProvider = deviceProvider; }