コード例 #1
0
        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();
        }
コード例 #2
0
 public ConnectionChannelHandlerAdapter(ILogger logger, IDeviceProvider deviceProvider, ITcpServiceEntryProvider tcpServiceEntryProvider, TcpServerProperties tcpServerProperties)
 {
     _logger                  = logger;
     _deviceProvider          = deviceProvider;
     _tcpServiceEntryProvider = tcpServiceEntryProvider;
     _tcpServerProperties     = tcpServerProperties;
 }
コード例 #3
0
        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));
        }
コード例 #4
0
 private void _deviceProvider_RoomStructureChanged(IDeviceProvider obj)
 {
     _updatingGroupedDevices = true;
     RaisePropertyChanged("GroupedDevices");
     _updatingGroupedDevices = false;
     SelectedDevicesChanged(this, _deviceProvider.SelectedDevices);
 }
コード例 #5
0
        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,
            });
        }
コード例 #6
0
 public DeployWindows(IDeviceProvider deviceProvider, IDiskLayoutPreparer preparer, IProviderBasedWindowsDeployer providerBasedWindowsDeployer, IDownloadProgress progressObserver)
 {
     this.deviceProvider = deviceProvider;
     this.preparer       = preparer;
     this.providerBasedWindowsDeployer = providerBasedWindowsDeployer;
     this.progressObserver             = progressObserver;
 }
コード例 #7
0
ファイル: SITScanner.cs プロジェクト: bietiekay/YAPS
        /// <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;
        }
コード例 #8
0
        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;
        }
コード例 #9
0
        public StorageProvider(IDeviceProvider deviceProvider, IDbConnectionFactory dbConnectionFactory)
        {
            this.deviceProvider      = deviceProvider;
            this.dbConnectionFactory = dbConnectionFactory;

            using (var ctx = dbConnectionFactory.GetConnection())
            {
                //create if not exists
                ctx.CreateTable <MainTable>();
            }
        }
コード例 #10
0
ファイル: ServiceParser.cs プロジェクト: bietiekay/YAPS
        /// <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);
        }
コード例 #11
0
        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();
        }
コード例 #12
0
        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();
            });
        }
コード例 #13
0
        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);
            }
        }
コード例 #14
0
        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();
        }
コード例 #15
0
        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); }
        }
コード例 #16
0
ファイル: MainForm.cs プロジェクト: zipa/wiidevicelibrary
        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();
        }
コード例 #17
0
        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();
        }
コード例 #18
0
        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>();
        }
コード例 #19
0
ファイル: MainForm.cs プロジェクト: Nielk1/VSCView
        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();
        }
コード例 #20
0
        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();
        }
コード例 #21
0
        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);
        }
コード例 #22
0
        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);
            }
        }
コード例 #23
0
 protected DeviceDemoBase(IDeviceProvider deviceProvider, ILogger logger)
 {
     Logger         = logger ?? throw new ArgumentNullException(nameof(logger));
     DeviceProvider = deviceProvider ?? throw new ArgumentNullException(nameof(deviceProvider));
 }
コード例 #24
0
ファイル: Parser.cs プロジェクト: bietiekay/YAPS
 /// <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);
 }
コード例 #25
0
ファイル: Parser.cs プロジェクト: bietiekay/YAPS
 /// <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);
 }
コード例 #26
0
 private void _deviceProvider_SelectedDevicesChanged(IDeviceProvider sender, IReadOnlyList <Device> selected)
 {
     RaisePropertyChanged("SelectedDevices");
     RaisePropertyChanged("ActiveProperties");
     SelectedDevicesChanged?.Invoke(this, selected);
 }
コード例 #27
0
 public FilterWheelDemo(IDeviceProvider deviceProvider, ILogger logger) : base(deviceProvider, logger)
 {
 }
コード例 #28
0
 public ProviderBasedWindowsDeployer(IWindowsOptionsProvider optionsProvider, IDeviceProvider deviceProvider, IWindowsDeployer deployer)
 {
     this.optionsProvider = optionsProvider;
     this.deviceProvider  = deviceProvider;
     this.deployer        = deployer;
 }
コード例 #29
0
 public TcpService(IDeviceProvider deviceProvider)
 {
     _deviceProvider = deviceProvider;
 }
コード例 #30
0
ファイル: PMTManager.cs プロジェクト: bietiekay/YAPS
 /// <summary>
 /// 
 /// </summary>
 /// <param name="device">Hardware abstraction to use.</param>
 public PMTManager(IDeviceProvider device)
 {
     // Remember
     m_Device = device;
 }
コード例 #31
0
ファイル: MainForm.cs プロジェクト: nydehi/wiidevicelibrary
        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();
        }
コード例 #32
0
ファイル: SITScanner.cs プロジェクト: bietiekay/YAPS
        /// <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);
            }
        }
コード例 #33
0
 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;
 }
コード例 #34
0
 public DomeDemo(IDeviceProvider deviceProvider, ILogger logger) : base(deviceProvider, logger)
 {
 }
コード例 #35
0
 public DualshockReporter(IDeviceProvider deviceProvider)
 {
     _deviceProvider = deviceProvider;
 }
コード例 #36
0
 public DeviceManager(ILoggerProvider loggerProvider, IDeviceProvider deviceProvider)
 {
     _logger         = loggerProvider.CreateLogger <DeviceManager>();
     _deviceProvider = deviceProvider;
 }
コード例 #37
0
 public RaspberryPathBuilder(IDeviceProvider deviceProvider)
 {
     this.deviceProvider = deviceProvider;
 }
コード例 #38
0
ファイル: InterfaceHuawei.cs プロジェクト: cesarerr1/Huawei01
        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);
            }
        }
コード例 #39
0
ファイル: StoreViewModel.cs プロジェクト: quangvd3/VanArsdel
 public StoreViewModel(IOverlayProvider overlayProvider, IStringProvider stringProvider, IDeviceProvider deviceProvider)
 {
     _overlayProvider = overlayProvider;
     _stringProvider  = stringProvider;
     _deviceProvider  = deviceProvider;
 }