public void OnHouseholdDeviceDeleteComplete(bool success, Exception error) { if (error != null) { if (error is APIException) { APIException exception = error as APIException; if (exception.Code != APIException.DeviceNotInDomain) { Console.WriteLine("Failed to delete household device: " + error.Message); code = -1; openTasks = 0; return; } } else { Console.WriteLine("Failed to delete household device: " + error.Message); code = -1; openTasks = 0; return; } } HouseholdDevice newDevice = new HouseholdDevice(); newDevice.Name = MASTER_DEVICE; newDevice.Udid = MASTER_DEVICE; newDevice.BrandId = MASTER_DEVICE_BRAND; HouseholdDeviceService.Add(newDevice) .SetCompletion(new OnCompletedHandler <HouseholdDevice>(OnHouseholdDeviceAddComplete)) .Execute(client); }
private void AddHouseholdDevice() { openTasks++; HouseholdDeviceService.Delete(MASTER_DEVICE) .SetCompletion(new OnCompletedHandler <bool>(OnHouseholdDeviceDeleteComplete)) .Execute(client); }
private void GetHouseholdDevice() { openTasks++; HouseholdDeviceService.Get() .SetCompletion(new OnCompletedHandler <HouseholdDevice>(OnHouseholdDeviceGetComplete)) .Execute(client); }
public void OnHouseholdDeviceAddComplete(HouseholdDevice householdDevice, Exception error) { if (error != null) { Console.WriteLine("Failed to delete household device: " + error.Message); code = -1; openTasks = 0; return; } HouseholdDeviceService.Delete(householdDevice.Udid) .SetCompletion(new OnCompletedHandler <bool>(OnHouseholdDeviceDeleteComplete)) .Execute(client); }
private void AddHouseholdDevice() { openTasks++; HouseholdDevice newDevice = new HouseholdDevice(); newDevice.Name = Guid.NewGuid().ToString(); newDevice.Udid = Guid.NewGuid().ToString(); newDevice.BrandId = MASTER_DEVICE_BRAND; HouseholdDeviceService.Add(newDevice) .SetCompletion(new OnCompletedHandler <HouseholdDevice>(OnHouseholdDeviceAddComplete)) .Execute(client); }