// Overridden from IDeviceManager public Task <InitializationResult> InitAsync() { deviceFactory = DeviceFactory.CreateFromStream(EmbeddedResource.Load(DEVICES_XML)); if (deviceFactory == null) { return(Task.FromResult(new InitializationResult() { success = false, errorMessage = "Failed to init device manager: could not load device's database." })); } return(Task.FromResult(new InitializationResult() { success = __isInitialized = true })); }
// Implemented from IDeviceManager public Task <InitializationResult> InitAsync() { Log.D(this, "loading the base device manager"); try { deviceFactory = DeviceFactory.CreateFromStream(EmbeddedResource.Load(DEVICES_XML)); } catch (Exception e) { Log.E(this, "Failed from device factor", e); } Log.D(this, "device factory set"); if (deviceFactory == null) { return(Task.FromResult(new InitializationResult() { success = false, errorMessage = "Failed to init device manager: could not load device database.", })); } return(Task.FromResult(new InitializationResult() { success = true })); }
// Overridden from IDeviceManager public async Task <InitializationResult> InitAsync() { try { deviceFactory = DeviceFactory.CreateFromStream(EmbeddedResource.Load(DEVICES_XML)); } catch (Exception e) { Log.E(this, "Failed from device factor", e); } if (deviceFactory == null) { return(new InitializationResult() { success = false, errorMessage = "Failed to init device manager: could not load device database." }); } try { var devices = await ion.database.QueryForAllDevicesAsync(); foreach (IDevice device in devices) { try { Register(device); } catch (Exception ee) { Log.E(this, "Failed to register device", ee); } } } catch (Exception e) { Log.E(this, "Failed to load previous devices", e); } return(new InitializationResult() { success = __isInitialized = true }); }