예제 #1
0
 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",
         }),
     });
 }
예제 #2
0
 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"
         }),
     });
 }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }