当前位置: 首页>>代码示例>>C#>>正文


C# ILibraryService.GetObjectsFromFile方法代码示例

本文整理汇总了C#中ILibraryService.GetObjectsFromFile方法的典型用法代码示例。如果您正苦于以下问题:C# ILibraryService.GetObjectsFromFile方法的具体用法?C# ILibraryService.GetObjectsFromFile怎么用?C# ILibraryService.GetObjectsFromFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ILibraryService的用法示例。


在下文中一共展示了ILibraryService.GetObjectsFromFile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EditViewModel

 public EditViewModel(ILibraryService libraryService, IEventAggregator eventAggregator)
 {
     this._eventAggregator = eventAggregator;
     var orderedEnumerable = libraryService.GetObjectsFromFile().Videos.OrderBy(v=>v.Category).ToList();
     this.Videos = new ObservableCollection<Video>(orderedEnumerable);
     this.SelectedVideo = this.Videos.FirstOrDefault();
 }
开发者ID:Ledragon,项目名称:VideoPlayer,代码行数:7,代码来源:EditViewModel.cs

示例2: TagsListViewModel

 public TagsListViewModel(ITagsListView view, ILibraryService libraryService, IEventAggregator eventAggregator)
     : base(view)
 {
     this._eventAggregator = eventAggregator;
     this.SelectedTags = new ObservableCollection<CategoryViewModel>();
     this.Tags = new ObservableCollection<CategoryViewModel>();
     var videos = libraryService.GetObjectsFromFile().Videos;
     IEnumerable<String> tags =
         videos.SelectMany(v => v.Tags).Select(t => t.Value).Distinct().OrderBy(t => t);
     foreach (var tag in tags)
     {
         this.Tags.Add(new CategoryViewModel
         {
             Name = tag,
             Count = videos.Count(v => v.Tags.Any(t => t.Value == tag))
         });
     }
 }
开发者ID:Ledragon,项目名称:VideoPlayer,代码行数:18,代码来源:TagsListViewModel.cs

示例3: PlayListViewModel

        public PlayListViewModel(IPlayListView view, IEventAggregator eventAggregator, ILibraryService libraryService)
            : base(view)
        {
            this._libraryService = libraryService;
            this.Playlist = new ObservableCollection<Video>();

            this.RemoveCommand = new DelegateCommand(() => this.Remove(this.CurrentVideo));

            this.AddCommand = new DelegateCommand<Video>(this.Add);
            this.AddRangeCommand = new DelegateCommand<IEnumerable<Video>>(this.Add);
            this.SavePlaylistCommand = new DelegateCommand(this.Save);

            eventAggregator.GetEvent<OnAddVideo>().Subscribe(this.Add);
            eventAggregator.GetEvent<OnAddVideoRange>().Subscribe(this.Add);

            eventAggregator.GetEvent<OnPlayPlaylistRequest>()
                .Subscribe(dummy => { eventAggregator.GetEvent<OnPlayPlaylist>().Publish(this.Playlist); }, true);

            this._playListCollection = new ObservableCollection<Playlist>(libraryService.GetObjectsFromFile().PlayLists);
        }
开发者ID:Ledragon,项目名称:VideoPlayer,代码行数:20,代码来源:PlayListViewModel.cs

示例4: CreateTags

 private void CreateTags(ILibraryService libraryService)
 {
     this.Tags.Clear();
     var videos = libraryService.GetObjectsFromFile()
         .Videos;
     IEnumerable<Tag> tags = videos
         .SelectMany(v => v.Tags)
         .Distinct()
         .OrderBy(t=>t.Value);
     foreach (var tag in tags)
     {
         this.Tags.Add(tag);
     }
 }
开发者ID:Ledragon,项目名称:VideoPlayer,代码行数:14,代码来源:EditVideoViewModel.cs

示例5: CreateCategories

 private void CreateCategories(ILibraryService libraryService)
 {
     this.CategoryViewModels.Clear();
     IEnumerable<IGrouping<string, Video>> categories =
         libraryService.GetObjectsFromFile()
             .Videos.Where(v => !String.IsNullOrEmpty(v.Category))
             .GroupBy(v => v.Category)
             .OrderBy(g=>g.Key);
     foreach (var category in categories)
     {
         this.CategoryViewModels.Add(new CategoryViewModel
         {
             Name = category.Key,
             Count = category.Count()
         });
     }
     if (this.CategoryViewModels.Any())
     {
         CategoryViewModel vm = this.CategoryViewModels.First();
         if (this.Video != null && !String.IsNullOrEmpty(this.Video.Category))
         {
             vm = this.CategoryViewModels.FirstOrDefault(c => c.Name == this.Video.Category);
         }
         this.SelectedCategory = vm;
     }
 }
开发者ID:Ledragon,项目名称:VideoPlayer,代码行数:26,代码来源:EditVideoViewModel.cs


注:本文中的ILibraryService.GetObjectsFromFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。