コード例 #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
ファイル: DataService.cs プロジェクト: vaginessa/Pushbullet-2
        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);
        }