// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { // create a new window instance based on the screen size this.window = new UIWindow(UIScreen.MainScreen.Bounds); // If you have defined a root view controller, set it here: this.controller = new MainViewController(); this.window.RootViewController = this.controller; // make the window visible this.window.MakeKeyAndVisible(); DependencyResolver.Current.RegisterService <IDevice>(t => AppleDevice.CurrentDevice()); DependencyResolver.Current.RegisterService <ISQLitePlatform, SQLitePlatformIOS>(); DependencyResolver.Current.RegisterService <IPhone, PhoneImplementation> (); this.OnStart(); Resolver.GetService <StoreAccelerometerData>().Start(); Resolver.GetService <StoreLocationChange> ().Start(); var device = Resolver.GetService <IDevice> (); System.Diagnostics.Debug.WriteLine(string.Format("Device {0} a phone.", device.Phone != null ? "is" : "is not")); System.Diagnostics.Debug.WriteLine(device.Screen); System.Diagnostics.Debug.WriteLine(device.Name); System.Diagnostics.Debug.WriteLine(device.HardwareVersion); System.Diagnostics.Debug.WriteLine(device.FirmwareVersion); return(true); }
internal static void MapTo(this AppleDevice device, UserAppleDeviceEntity entity) { entity.id = device.Id; entity.ownerId = device.OwnerId; entity.deviceToken = device.DeviceToken; entity.active = device.Active; }
public ActionResult RegisterDevice(string deviceToken) { try { // strip spaces and brackets var deviceTokenToStore = deviceToken.Replace(" ", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty); var employer = CurrentEmployer; var devices = _appleDevicesQuery.GetDevices(employer.Id); if (devices == null || devices.Count == 0 || !devices.Select(s => s.DeviceToken).Contains(deviceTokenToStore)) { var newDevice = new AppleDevice { OwnerId = employer.Id, Active = true, DeviceToken = deviceTokenToStore, }; _appleDevicesCommand.CreateDevice(newDevice); } } catch (UserException ex) { ModelState.AddModelError(ex, new StandardErrorHandler()); } return(Json(new JsonResponseModel())); }
private void CreateDevice(AppleDevice device) { device.Prepare(); device.Validate(); _repository.CreateUserAppleDevice(device); }
public void MoveToAppleLepTop() { if (AppleDevice.Displayed) { AppleDevice.Click(); } }
private void RegisterDevice(Guid employerId, string deviceToken) { if (string.IsNullOrEmpty(deviceToken)) { return; } // strip spaces and brackets var deviceTokenToStore = deviceToken.Replace(" ", string.Empty).Replace("<", string.Empty).Replace(">", string.Empty); var devices = _appleDevicesQuery.GetDevices(employerId).Select(s => s.DeviceToken); if (devices.Contains(deviceTokenToStore)) { return; } var newDevice = new AppleDevice { OwnerId = employerId, Active = true, DeviceToken = deviceTokenToStore, }; _appleDevicesCommand.CreateDevice(newDevice); }
internal static UserAppleDeviceEntity Map(this AppleDevice device) { var entity = new UserAppleDeviceEntity(); device.MapTo(entity); return(entity); }
void IAppleDevicesRepository.CreateUserAppleDevice(AppleDevice userDevice) { using (var dc = CreateContext()) { dc.UserAppleDeviceEntities.InsertOnSubmit(userDevice.Map()); dc.SubmitChanges(); } }
protected AppleDevice CreateDevice(Guid ownerId, string deviceToken) { var device = new AppleDevice { Active = true, DeviceToken = "BogusDeviceToken", OwnerId = ownerId }; _appleDevicesCommand.CreateDevice(device); return(device); }
void IAppleDevicesRepository.UpdateUserAppleDevice(AppleDevice userDevice) { using (var dc = CreateContext()) { var entity = GetUserAppleDeviceEntityQuery(dc, userDevice.Id); if (entity != null) { userDevice.MapTo(entity); dc.SubmitChanges(); } } }
static void Main(string[] args) { var winDevice = new WindowsDevice(new MicrosoftAccount("1234", "nadiac"), new WindowsStore()); winDevice.LogIntoAppStore(); winDevice.ResetUserPassword(); foreach (var result in winDevice.SearchForApp("notepad")) { Console.WriteLine(result); } Console.WriteLine(); var appleDevice = new AppleDevice(); appleDevice.LogIntoAppStore(); appleDevice.ResetUserPassword(); foreach (var result in appleDevice.SearchForApp("texteditor")) { Console.WriteLine(result); } }
private void RegisterDevice() { var deviceInfo = AppleDevice.GetDeviceInfo(); switch (deviceInfo.Type) { case DeviceType.Phone: DependencyService.Register <IDevice, Phone>(); break; case DeviceType.Pad: DependencyService.Register <IDevice, Pad>(); break; case DeviceType.Pod: DependencyService.Register <IDevice, Pod>(); break; default: DependencyService.Register <IDevice, Simulator>(); break; } }
public void CallDeviceMethods() { IRivicDevice objrivicDevice = new AppleDevice(); objrivicDevice.DisplayStatus(); }
private void UpdateDevice(AppleDevice device) { device.Validate(); _repository.UpdateUserAppleDevice(device); }
void IAppleDevicesCommand.UpdateDevice(AppleDevice device) { UpdateDevice(device); }
void IAppleDevicesCommand.CreateDevice(AppleDevice device) { CreateDevice(device); }