public ObservableCollection <ItemViewModel> GetPushes() { return(new ObservableCollection <ItemViewModel> { ItemViewModelFactory.FromPush(new NotePush { Title = "Push 1", Body = "Push text", Type = PushbulletPushType.Note }), ItemViewModelFactory.FromPush(new LinkPush { Title = "Push 2", Url = "www.pushbullet.com", }), ItemViewModelFactory.FromPush(new ListPush()), ItemViewModelFactory.FromPush(new AddressPush { Address = "Content", }), ItemViewModelFactory.FromPush(new FilePush { FileName = "Push 5", FileUrl = "DL link", }), }); }
public ObservableCollection <ItemViewModel> GetDevices() { return(new ObservableCollection <ItemViewModel> { ItemViewModelFactory.FromDevice(new PushbulletDevice { Nickname = "Device 1", Type = PushbulletDeviceType.Windows, Model = "Windows device" }), ItemViewModelFactory.FromDevice(new PushbulletDevice { Nickname = "Device 2", Type = PushbulletDeviceType.Android, Model = "Android device" }), ItemViewModelFactory.FromDevice(new PushbulletDevice { Nickname = "Device 3", Type = PushbulletDeviceType.Chrome, Model = "Chrome device" }), ItemViewModelFactory.FromDevice(new PushbulletDevice { Nickname = "Device 4", Type = PushbulletDeviceType.Firefox, Model = "Firefox device" }), }); }
public ObservableCollection <ItemViewModel> GetPushes() { EnsureClient(); var pushesModel = new ObservableCollection <ItemViewModel>(); PushbulletPushes pushes = _client.GetPushes(); foreach (ActivePush push in pushes.Pushes.OfType <ActivePush>().OrderByDescending(push => push.CreatedRaw)) { pushesModel.Add(ItemViewModelFactory.FromPush(push)); } return(pushesModel); }
public ObservableCollection <ItemViewModel> GetDevices() { EnsureClient(); var devicesModel = new ObservableCollection <ItemViewModel>(); Devices = _client.GetDevices().Devices.ToDictionary(device => device.Id, device => device); foreach (PushbulletDevice device in Devices.Values) { devicesModel.Add(ItemViewModelFactory.FromDevice(device)); } return(devicesModel); }