Ejemplo n.º 1
0
        private void InitCollectionViews()
        {
            SortDescription description  = new SortDescription("SortName", ListSortDirection.Ascending);
            SortDescription description2 = new SortDescription("Album", ListSortDirection.Ascending);
            SortDescription description3 = new SortDescription("Artist", ListSortDirection.Ascending);
            SortDescription description4 = new SortDescription("Disk", ListSortDirection.Ascending);
            SortDescription description5 = new SortDescription("Track", ListSortDirection.Ascending);
            SortDescription description6 = new SortDescription("ZmdbId", ListSortDirection.Ascending);

            this.music = new CollectionViewSource();
            this.music.SortDescriptions.Add(description3);
            this.music.SortDescriptions.Add(description2);
            this.music.SortDescriptions.Add(description4);
            this.music.SortDescriptions.Add(description5);
            this.music.SortDescriptions.Add(description6);
            this.musicSource       = new List <DeviceItemViewModel>();
            this.music.Source      = this.musicSource;
            this.music.View.Filter = item => ((DeviceItemViewModel)item).DoesMatchFilter(this.musicFilterStringUpper);
            this.musicRefresh      = new BatchingTimer(delegate {
                this.refreshView(this.music);
            }, 200);
            this.moviesTVShows = new CollectionViewSource();
            this.moviesTVShows.SortDescriptions.Add(description);
            this.moviesTVShows.SortDescriptions.Add(description6);
            this.moviesTVShowsSource       = new List <DeviceItemViewModel>();
            this.moviesTVShows.Source      = this.moviesTVShowsSource;
            this.moviesTVShows.View.Filter = item => ((DeviceItemViewModel)item).DoesMatchFilter(this.moviesTVSeriesFilterStringUpper);
            this.moviesTVShowsRefresh      = new BatchingTimer(delegate {
                this.refreshView(this.moviesTVShows);
            }, 200);
            this.podcasts = new CollectionViewSource();
            this.podcasts.SortDescriptions.Add(description);
            this.podcasts.SortDescriptions.Add(description6);
            this.podcastsSource       = new List <DeviceItemViewModel>();
            this.podcasts.Source      = this.podcastsSource;
            this.podcasts.View.Filter = item => ((DeviceItemViewModel)item).DoesMatchFilter(this.podcastsFilterStringUpper);
            this.podcastsRefresh      = new BatchingTimer(delegate {
                this.refreshView(this.podcasts);
            }, 200);
            this.photoVideoAlbums = new CollectionViewSource();
            this.photoVideoAlbums.SortDescriptions.Add(description);
            this.photoVideoAlbums.SortDescriptions.Add(description6);
            this.photoVideoAlbumsSource       = new List <DeviceItemViewModel>();
            this.photoVideoAlbums.Source      = this.photoVideoAlbumsSource;
            this.photoVideoAlbums.View.Filter = item => ((DeviceItemViewModel)item).DoesMatchFilter(this.photosVideosFilterStringUpper);
            this.photoVideoAlbumsRefresh      = new BatchingTimer(delegate {
                this.refreshView(this.photoVideoAlbums);
            }, 200);
        }
Ejemplo n.º 2
0
 public SyncPartnership(IDevice device, ISyncFactory factory)
 {
     if (factory == null)
     {
         throw new ArgumentNullException(typeof(ISyncFactory).ToString());
     }
     this.factory = factory;
     this.sourceContentLoadingListener = new EventHandler<ContentLoadingEventArgs>(this.OnContentLoading);
     this.Device = device;
     this.reloadSourcesTimer = new BatchingTimer(new Action(this.LoadSourceContent), 0x3e8);
     this.InitPartnership();
     this.attemptedSyncOperations = new List<SyncOperation>();
     this.successfulSyncOperations = new List<SyncOperation>();
     this.successfulCumulativeSyncOperations = new List<SyncOperation>();
     this.successfulAcquiredOperations = new List<SyncOperation>();
 }
Ejemplo n.º 3
0
 public SyncPartnership(IDevice device, ISyncFactory factory)
 {
     if (factory == null)
     {
         throw new ArgumentNullException(typeof(ISyncFactory).ToString());
     }
     this.factory = factory;
     this.sourceContentLoadingListener = new EventHandler <ContentLoadingEventArgs>(this.OnContentLoading);
     this.Device             = device;
     this.reloadSourcesTimer = new BatchingTimer(new Action(this.LoadSourceContent), 0x3e8);
     this.InitPartnership();
     this.attemptedSyncOperations            = new List <SyncOperation>();
     this.successfulSyncOperations           = new List <SyncOperation>();
     this.successfulCumulativeSyncOperations = new List <SyncOperation>();
     this.successfulAcquiredOperations       = new List <SyncOperation>();
 }
        public SyncOptionListViewModel(ISyncOptionList list, SelectableOptionViewModel parent, string filter)
        {
            Action <ISyncSelectionOption> action = null;

            this.lockObject   = new object();
            this.parent       = parent;
            this.FilterString = filter;
            if (list == null)
            {
                throw new ArgumentNullException(typeof(ISyncOptionList).ToString());
            }
            this.model = list;
            if (action == null)
            {
                action = delegate(ISyncSelectionOption o) {
                    this.Add(new SelectableOptionViewModel(o, this, parent, filter));
                };
            }
            list.Options.ToList <ISyncSelectionOption>().ForEach(action);
            this.buffer = new BatchingTimer(new Action <List <object> >(this.ProcessChanges), 0x3e8);
            this.model.CollectionChanged += new NotifyCollectionChangedEventHandler(this.OnModelCollectionChanged);
        }
Ejemplo n.º 5
0
 public TreeListBox()
 {
     this.resetTimer = new BatchingTimer(new Action(this.ResetFlattenedListAction), 100);
 }
Ejemplo n.º 6
0
 private void InitCollectionViews()
 {
     SortDescription description = new SortDescription("SortName", ListSortDirection.Ascending);
     SortDescription description2 = new SortDescription("Album", ListSortDirection.Ascending);
     SortDescription description3 = new SortDescription("Artist", ListSortDirection.Ascending);
     SortDescription description4 = new SortDescription("Disk", ListSortDirection.Ascending);
     SortDescription description5 = new SortDescription("Track", ListSortDirection.Ascending);
     SortDescription description6 = new SortDescription("ZmdbId", ListSortDirection.Ascending);
     this.music = new CollectionViewSource();
     this.music.SortDescriptions.Add(description3);
     this.music.SortDescriptions.Add(description2);
     this.music.SortDescriptions.Add(description4);
     this.music.SortDescriptions.Add(description5);
     this.music.SortDescriptions.Add(description6);
     this.musicSource = new List<DeviceItemViewModel>();
     this.music.Source = this.musicSource;
     this.music.View.Filter = item => ((DeviceItemViewModel) item).DoesMatchFilter(this.musicFilterStringUpper);
     this.musicRefresh = new BatchingTimer(delegate {
         this.refreshView(this.music);
     }, 200);
     this.moviesTVShows = new CollectionViewSource();
     this.moviesTVShows.SortDescriptions.Add(description);
     this.moviesTVShows.SortDescriptions.Add(description6);
     this.moviesTVShowsSource = new List<DeviceItemViewModel>();
     this.moviesTVShows.Source = this.moviesTVShowsSource;
     this.moviesTVShows.View.Filter = item => ((DeviceItemViewModel) item).DoesMatchFilter(this.moviesTVSeriesFilterStringUpper);
     this.moviesTVShowsRefresh = new BatchingTimer(delegate {
         this.refreshView(this.moviesTVShows);
     }, 200);
     this.podcasts = new CollectionViewSource();
     this.podcasts.SortDescriptions.Add(description);
     this.podcasts.SortDescriptions.Add(description6);
     this.podcastsSource = new List<DeviceItemViewModel>();
     this.podcasts.Source = this.podcastsSource;
     this.podcasts.View.Filter = item => ((DeviceItemViewModel) item).DoesMatchFilter(this.podcastsFilterStringUpper);
     this.podcastsRefresh = new BatchingTimer(delegate {
         this.refreshView(this.podcasts);
     }, 200);
     this.photoVideoAlbums = new CollectionViewSource();
     this.photoVideoAlbums.SortDescriptions.Add(description);
     this.photoVideoAlbums.SortDescriptions.Add(description6);
     this.photoVideoAlbumsSource = new List<DeviceItemViewModel>();
     this.photoVideoAlbums.Source = this.photoVideoAlbumsSource;
     this.photoVideoAlbums.View.Filter = item => ((DeviceItemViewModel) item).DoesMatchFilter(this.photosVideosFilterStringUpper);
     this.photoVideoAlbumsRefresh = new BatchingTimer(delegate {
         this.refreshView(this.photoVideoAlbums);
     }, 200);
 }
Ejemplo n.º 7
0
 public TreeListBox()
 {
     this.resetTimer = new BatchingTimer(new Action(this.ResetFlattenedListAction), 100);
 }