• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Dto.BaseItemDto类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MediaBrowser.Model.Dto.BaseItemDto的典型用法代码示例。如果您正苦于以下问题:C# BaseItemDto类的具体用法?C# BaseItemDto怎么用?C# BaseItemDto使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BaseItemDto类属于MediaBrowser.Model.Dto命名空间,在下文中一共展示了BaseItemDto类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetPlayablePath

        /// <summary>
        /// Gets the playable path.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <param name="isoMount">The iso mount.</param>
        /// <param name="apiClient">The API client.</param>
        /// <param name="startTimeTicks">The start time ticks.</param>
        /// <returns>System.String.</returns>
        public static string GetPlayablePath(BaseItemDto item, IIsoMount isoMount, IApiClient apiClient, long? startTimeTicks)
        {
            // Check the mounted path first
            if (isoMount != null)
            {
                if (item.IsoType.HasValue && item.IsoType.Value == IsoType.BluRay)
                {
                    return GetBlurayPath(isoMount.MountedPath);
                }

                return isoMount.MountedPath;
            }

            // Stream remote items through the api
            if (item.LocationType == LocationType.Remote)
            {
                return GetStreamedPath(item, apiClient, startTimeTicks);
            }

            // Stream if we can't access the file system
            if (!File.Exists(item.Path) && !Directory.Exists(item.Path))
            {
                return GetStreamedPath(item, apiClient, startTimeTicks);
            }

            if (item.VideoType.HasValue && item.VideoType.Value == VideoType.BluRay)
            {
                return GetBlurayPath(item.Path);
            }

            return item.Path;
        }
开发者ID:TomGillen,项目名称:MBT,代码行数:40,代码来源:PlayablePathBuilder.cs


示例2: OnNavigatedTo

 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     if (e.NavigationMode == NavigationMode.New)
     {
         var selectedItem = new BaseItemDto();
         if(App.SelectedItem == null)
         {
             string name, id;
             if (NavigationContext.QueryString.TryGetValue("name", out name) &&
                 NavigationContext.QueryString.TryGetValue("id", out id))
             {
                 selectedItem = new BaseItemDto
                                    {
                                        Name = name,
                                        Id = id,
                                        Type = "FolderCollection"
                                    };
             }
         }
         if (App.SelectedItem is BaseItemDto)
         {
             selectedItem = (BaseItemDto) App.SelectedItem;
         }
         DataContext = new FolderViewModel(ViewModelLocator.NavigationService, ViewModelLocator.ConnectionManager)
         {
             SelectedFolder = selectedItem
         };
     }
 }
开发者ID:zardaloop,项目名称:Emby.WindowsPhone,代码行数:30,代码来源:CollectionView.xaml.cs


示例3: UpdateCommunityRating

        /// <summary>
        /// Updates the community rating.
        /// </summary>
        /// <param name="item">The item.</param>
        private void UpdateCommunityRating(BaseItemDto item)
        {
            if (!item.CommunityRating.HasValue)
            {
                return;
            }

            var images = new[] { ImgCommunityRating1, ImgCommunityRating2, ImgCommunityRating3, ImgCommunityRating4, ImgCommunityRating5 };

            var rating = item.CommunityRating.Value;

            for (var i = 0; i < 5; i++)
            {
                var img = images[i];

                var starValue = (i + 1) * 2;

                if (rating < starValue - 2)
                {
                    img.SetResourceReference(StyleProperty, "CommunityRatingImageEmpty");
                }
                else if (rating < starValue)
                {
                    img.SetResourceReference(StyleProperty, "CommunityRatingImageHalf");
                }
                else
                {
                    img.SetResourceReference(StyleProperty, "CommunityRatingImageFull");
                }
            }
        }
开发者ID:Rainking720,项目名称:MediaBrowser.Theater,代码行数:35,代码来源:ItemRating.xaml.cs


示例4: TrailerViewModel

 /// <summary>
 /// Initializes a new instance of the TrailerViewModel class.
 /// </summary>
 public TrailerViewModel(INavigationService navigation, IConnectionManager connectionManager)
     : base(navigation, connectionManager)
 {
     if (IsInDesignMode)
     {
         SelectedTrailer = new BaseItemDto
         {
             Name = "Jurassic Park 3D",
             Overview =
                 "Universal Pictures will release Steven Spielberg\u2019s groundbreaking masterpiece JURASSIC PARK in 3D on April 5, 2013.  With his remastering of the epic into a state-of-the-art 3D format, Spielberg introduces the three-time Academy Award\u00AE-winning blockbuster to a new generation of moviegoers and allows longtime fans to experience the world he envisioned in a way that was unimaginable during the film\u2019s original release.  Starring Sam Neill, Laura Dern, Jeff Goldblum, Samuel L. Jackson and Richard Attenborough, the film based on the novel by Michael Crichton is produced by Kathleen Kennedy and Gerald R. Molen.",
             PremiereDate = DateTime.Parse("2013-04-05T00:00:00.0000000"),
             Id = "4aed3d79a0c4c2a0ac9c91fb7a641f1a",
             ProductionYear = 2013,
             People = new[]
             {
                 new BaseItemPerson {Name = "Steven Spielberg", Type = "Director"},
                 new BaseItemPerson {Name = "Sam Neill", Type = "Actor"},
                 new BaseItemPerson {Name = "Richard Attenborough", Type = "Actor"},
                 new BaseItemPerson {Name = "Laura Dern", Type = "Actor"}
             }
         };
         CastAndCrew = Utils.GroupCastAndCrew(SelectedTrailer.People);
     }
     else
     {
         WireCommands();
     }
 }
开发者ID:zardaloop,项目名称:Emby.WindowsPhone,代码行数:31,代码来源:TrailerViewModel.cs


示例5: FolderViewModel

        /// <summary>
        /// Initializes a new instance of the FolderViewModel class.
        /// </summary>
        public FolderViewModel(INavigationService navigationService, IConnectionManager connectionManager)
            : base(navigationService, connectionManager)
        {
            RecentItems = new ObservableCollection<BaseItemDto>();
            RandomItems = new ObservableCollection<BaseItemDto>();

            if (IsInDesignMode)
            {
                SelectedFolder = new BaseItemDto
                {
                    Name = "Movies"
                };
                RecentItems.Add(new BaseItemDto
                {
                    Id = "6536a66e10417d69105bae71d41a6e6f",
                    Name = "Jurassic Park",
                    SortName = "Jurassic Park",
                    Overview = "Lots of dinosaurs eating people!",
                    People = new[]
                    {
                        new BaseItemPerson {Name = "Steven Spielberg", Type = "Director"},
                        new BaseItemPerson {Name = "Sam Neill", Type = "Actor"},
                        new BaseItemPerson {Name = "Richard Attenborough", Type = "Actor"},
                        new BaseItemPerson {Name = "Laura Dern", Type = "Actor"}
                    }

                });
            }
            else
            {
                WireCommands();
                GroupBy = GroupBy.Name;
            }
        }
开发者ID:zardaloop,项目名称:Emby.WindowsPhone,代码行数:37,代码来源:FolderViewModel.cs


示例6: MainViewModel

        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IConnectionManager connectionManager, INavigationService navigationService, IPlaybackManager playbackManager)
            : base(navigationService, connectionManager)
        {
            _playbackManager = playbackManager;
            Folders = new ObservableCollection<BaseItemDto>();
            RecentItems = new ObservableCollection<BaseItemDto>();
            FavouriteItems = new ObservableCollection<BaseItemDto>();
            InProgressItems = new ObservableCollection<BaseItemDto>();
            UserViews = new ObservableCollection<BaseItemDto>();

            if (IsInDesignMode)
            {
                Folders.Add(new BaseItemDto { Id = "78dbff5aa1c2101b98ebaf42b72a988d", Name = "Movies", UserData = new UserItemDataDto { UnplayedItemCount = 6 } });
                RecentItems.Add(new BaseItemDto { Id = "2fc6f321b5f8bbe842fcd0eed089561d", Name = "A Night To Remember" });
            }
            else
            {
                WireCommands();
                DummyFolder = new BaseItemDto
                {
                    Type = "folder",
                    Name = AppResources.LabelRecent.ToLower()
                };
            }
        }
开发者ID:gep13,项目名称:Emby.WindowsPhone,代码行数:28,代码来源:MainViewModel.cs


示例7: GetSections

 public override async Task<IEnumerable<IItemDetailSection>> GetSections(BaseItemDto item)
 {
     return new[] {
         await GetMovies(item),
         await GetSeries(item)
     };
 }
开发者ID:TomGillen,项目名称:MBT,代码行数:7,代码来源:PersonWorkSectionGenerator.cs


示例8: TvViewModel

        /// <summary>
        /// Initializes a new instance of the TvViewModel class.
        /// </summary>
        public TvViewModel(INavigationService navigationService, IConnectionManager connectionManager, IMessageBoxService messageBox) 
            : base(navigationService, connectionManager)
        {
            _messageBox = messageBox;
            RecentItems = new ObservableCollection<BaseItemDto>();
            Episodes = new List<BaseItemDto>();
            CanUpdateFavourites = true;
            if (IsInDesignMode)
            {
                SelectedTvSeries = new BaseItemDto
                {
                    Name = "Scrubs"
                };
                SelectedSeason = new BaseItemDto
                {
                    Name = "Season 1"
                };
                Episodes = new[]
                {
                    new BaseItemDto
                    {
                        Id = "e252ea3059d140a0274282bc8cd194cc",
                        Name = "1x01 - Pilot",
                        Overview =
                            "A Kindergarten teacher starts speaking gibberish and passed out in front of her class. What looks like a possible brain tumor does not respond to treatment and provides many more questions than answers for House and his team as they engage in a risky trial-and-error approach to her case. When the young teacher refuses any additional variations of treatment and her life starts slipping away, House must act against his code of conduct and make a personal visit to his patient to convince her to trust him one last time."
                    }
                }.ToList();
                SelectedEpisode = Episodes[0];

            }
            else
            {
                WireCommands();
            }
        }
开发者ID:gep13,项目名称:Emby.WindowsPhone,代码行数:38,代码来源:TvViewModel.cs


示例9: GetInstantMixPlaylist

        internal static async Task<List<PlaylistItem>> GetInstantMixPlaylist(this IApiClient apiClient, BaseItemDto item, IPlaybackManager playbackManager)
        {
            ItemsResult result;
            var query = new SimilarItemsQuery { UserId = AuthenticationService.Current.LoggedInUserId, Id = item.Id, Fields = new []{ ItemFields.MediaSources}};

            switch (item.Type)
            {
                case "Audio":
                    result = await apiClient.GetInstantMixFromSongAsync(query);
                    break;
                case "MusicArtist":
                    result = await apiClient.GetInstantMixFromArtistAsync(query);
                    break;
                case "MusicAlbum":
                    result = await apiClient.GetInstantMixFromAlbumAsync(query);
                    break;
                case "Genre":
                    result = await apiClient.GetInstantMixFromMusicGenreAsync(query);
                    break;
                default:
                    return new List<PlaylistItem>();
            }

            if (result == null || result.Items.IsNullOrEmpty())
            {
                return new List<PlaylistItem>();
            }

            return await result.Items.ToList().ToPlayListItems(apiClient, playbackManager);
        }
开发者ID:gep13,项目名称:Emby.WindowsPhone,代码行数:30,代码来源:ApiClientExtensions.cs


示例10: GetHomePage

 public Page GetHomePage(BaseItemDto rootFolder)
 {
     return new HomePage(rootFolder, _presentationManager)
     {
         DataContext = new HomePageViewModel(_presentationManager, _sessionManager, _logger, _imageManager, _navigationManager, _playbackManager, _connectionManager)
     };
 }
开发者ID:chandum2,项目名称:Emby.Theater,代码行数:7,代码来源:HomePageInfo.cs


示例11: SetTitle

 private void SetTitle(BaseItemDto item)
 {
     if (item.Taglines.Count > 0)
     {
         TxtName.Text = item.Taglines[0];
         TxtName.Visibility = Visibility.Visible;
     }
     else if (item.IsType("episode"))
     {
         TxtName.Text = GetEpisodeTitle(item);
         TxtName.Visibility = Visibility.Visible;
     }
     else if (item.IsType("audio"))
     {
         TxtName.Text = GetSongTitle(item);
         TxtName.Visibility = Visibility.Visible;
     }
     else if (item.IsPerson || item.IsArtist || item.IsGenre || item.IsGameGenre || item.IsMusicGenre || item.IsStudio)
     {
         TxtName.Text = item.Name;
         TxtName.Visibility = Visibility.Visible;
     }
     else
     {
         TxtName.Visibility = Visibility.Collapsed;
     }
 }
开发者ID:jfrankelp,项目名称:MediaBrowser.Theater,代码行数:27,代码来源:DetailPage.xaml.cs


示例12: VideoMessage

 public VideoMessage(IList<BaseItemDto> playlist, BaseItemDto firstItem, bool isResume)
 {
     VideoPlaylists = playlist;
     VideoItem = firstItem;
     IsResume = isResume;
     PlayerSourceType = PlayerSourceType.Playlist;
 }
开发者ID:gep13,项目名称:Emby.WindowsPhone,代码行数:7,代码来源:VideoMessage.cs


示例13: MovieViewModel

 /// <summary>
 /// Initializes a new instance of the MovieViewModel class.
 /// </summary>
 public MovieViewModel(INavigationService navigationService, IConnectionManager connectionManager)
     : base(navigationService, connectionManager)
 {
     CanUpdateFavourites = true;
     if (IsInDesignMode)
     {
         SelectedMovie = new BaseItemDto
         {
             Id = "6536a66e10417d69105bae71d41a6e6f",
             Name = "Jurassic Park",
             SortName = "Jurassic Park",
             Overview = "Lots of dinosaurs eating people!",
             People = new[]
             {
                 new BaseItemPerson {Name = "Steven Spielberg", Type = "Director"},
                 new BaseItemPerson {Name = "Sam Neill", Type = "Actor"},
                 new BaseItemPerson {Name = "Richard Attenborough", Type = "Actor"},
                 new BaseItemPerson {Name = "Laura Dern", Type = "Actor"}
             }
         };
     }
     else
     {
         WireCommands();
     }
 }
开发者ID:zardaloop,项目名称:Emby.WindowsPhone,代码行数:29,代码来源:MovieViewModel.cs


示例14: GetPlayablePath

        /// <summary>
        /// Gets the playable path.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <param name="isoMount">The iso mount.</param>
        /// <param name="apiClient">The API client.</param>
        /// <param name="startTimeTicks">The start time ticks.</param>
        /// <returns>System.String.</returns>
        public static string GetPlayablePath(BaseItemDto item, IIsoMount isoMount, IApiClient apiClient, long? startTimeTicks, int? maxBitrate)
        {
            // Check the mounted path first
            if (isoMount != null)
            {
                if (item.IsoType.HasValue && item.IsoType.Value == IsoType.BluRay)
                {
                    return GetBlurayPath(isoMount.MountedPath);
                }

                return isoMount.MountedPath;
            }

            if (item.LocationType == LocationType.FileSystem)
            {
                if (File.Exists(item.Path) || Directory.Exists(item.Path))
                {
                    if (item.VideoType.HasValue && item.VideoType.Value == VideoType.BluRay)
                    {
                        return GetBlurayPath(item.Path);
                    }

                    return item.Path;
                }
            }

            return GetStreamedPath(item, apiClient, startTimeTicks, maxBitrate);
        }
开发者ID:Rainking720,项目名称:MediaBrowser.Theater,代码行数:36,代码来源:PlayablePathBuilder.cs


示例15: OnItemChanged

        private void OnItemChanged(ItemViewModel viewModel, BaseItemDto item)
        {
            UpdateLogo(viewModel, item);

            TxtGenres.Visibility = item.Genres.Count > 0 && !item.IsType("episode") && !item.IsType("season") ? Visibility.Visible : Visibility.Collapsed;

            TxtGenres.Text = string.Join(" / ", item.Genres.Take(3).ToArray());
        }
开发者ID:Rainking720,项目名称:MediaBrowser.Theater,代码行数:8,代码来源:Sidebar.xaml.cs


示例16: UpdateLogo

        private async void UpdateLogo(ItemViewModel viewModel, BaseItemDto item)
        {
            DisposeLogoCancellationToken(_logoCancellationTokenSource, true);

            if (string.Equals(viewModel.ViewType, ListViewTypes.List))
            {
                PnlTitle.Visibility = Visibility.Visible;

                UpdateLogoForListView(viewModel, item);

                return;
            }

            if (item != null && (item.HasLogo || item.ParentLogoImageTag.HasValue))
            {
                var tokenSource = new CancellationTokenSource();

                _logoCancellationTokenSource = tokenSource;

                try
                {
                    var img = await viewModel.GetBitmapImageAsync(new ImageOptions
                    {
                        ImageType = ImageType.Logo

                    }, tokenSource.Token);

                    LogoImage.Source = img;

                    LogoImage.Visibility = Visibility.Visible;
                    LogoImage.HorizontalAlignment = HorizontalAlignment.Center;

                    // If the logo is owned by the current item, don't show the title
                    if (item.HasLogo)
                    {
                        PnlTitle.Visibility = Visibility.Collapsed;
                    }
                }
                catch (OperationCanceledException)
                {
                }
                catch
                {
                    LogoImage.Visibility = Visibility.Collapsed;
                    PnlTitle.Visibility = Visibility.Visible;
                }
                finally
                {
                    DisposeLogoCancellationToken(tokenSource, false);
                }
            }
            else
            {
                LogoImage.Visibility = Visibility.Collapsed;
                PnlTitle.Visibility = Visibility.Visible;
            }
        }
开发者ID:jfrankelp,项目名称:MediaBrowser.Theater,代码行数:57,代码来源:Sidebar.xaml.cs


示例17: FolderPage

        public FolderPage(BaseItemDto parent, DisplayPreferences displayPreferences, IApiClient apiClient, IImageManager imageManager, IPresentationManager presentation, INavigationService navigationManager, IPlaybackManager playbackManager, ILogger logger, ListPageConfig options)
        {
            _logger = logger;
            _presentationManager = presentation;
            _imageManager = imageManager;
            _apiClient = apiClient;
            _options = options;

            _parentItem = parent;

            InitializeComponent();

            Loaded += FolderPage_Loaded;

            SetDefaults(displayPreferences);

            var playAllFromHere = parent.IsType("playlist") || parent.IsType("musicalbum");

            _viewModel = new ItemListViewModel(vm => options.CustomItemQuery(vm, displayPreferences), _presentationManager, _imageManager, _apiClient, navigationManager, playbackManager, _logger)
            {
                ImageDisplayHeightGenerator = GetImageDisplayHeight,
                DisplayNameGenerator = options.DisplayNameGenerator ?? GetDisplayName,
                PreferredImageTypesGenerator = GetPreferredImageTypes,

                ShowSidebarGenerator = GetShowSidebar,
                ScrollDirectionGenerator = GetScrollDirection,

                AutoSelectFirstItem = true,

                ShowLoadingAnimation = true,

                PlayAllFromHereOnPlayCommand = playAllFromHere,
                PlayAllFromHereOnNavigateCommand = playAllFromHere
            };

            if (options.ShowTitle)
            {
                _viewModel.OnItemCreated = v =>
                {
                    v.DisplayNameVisibility = Visibility.Visible;
                };
            }

            _viewModel.AddIndexOptions(options.IndexOptions);

            _viewModel.PropertyChanged += _viewModel_PropertyChanged;

            _viewModel.DisplayPreferences = displayPreferences;

            if (!string.IsNullOrEmpty(options.IndexValue))
            {
                var index = options.IndexOptions.First(i => string.Equals(i.Name, options.IndexValue));
                _viewModel.IndexOptionsCollectionView.MoveCurrentTo(index);
            }

            DataContext = _viewModel;
        }
开发者ID:chandum2,项目名称:Emby.Theater,代码行数:57,代码来源:FolderPage.xaml.cs


示例18: GetRootFolder

        protected async Task<BaseItemDto> GetRootFolder()
        {
            if (_rootFolder == null)
            {
                _rootFolder = await ApiClient.GetRootFolderAsync(ApiClient.CurrentUserId);
            }

            return _rootFolder;
        }
开发者ID:amoisis,项目名称:MediaBrowser.Theater,代码行数:9,代码来源:BaseHomePageSectionViewModel.cs


示例19: GetStreamedPath

        private static string GetStreamedPath(BaseItemDto item, IApiClient apiClient, long? startTimeTicks)
        {
            var extension = item.LocationType == LocationType.Remote ? null : Path.GetExtension(item.Path);

            if (item.IsAudio)
            {
                if (item.LocationType == LocationType.Remote)
                {
                    return apiClient.GetAudioStreamUrl(new StreamOptions
                    {
                        ItemId = item.Id,
                        OutputFileExtension = ".aac",
                        AudioCodec = "aac",
                        StartTimeTicks = startTimeTicks
                    });
                }

                return apiClient.GetAudioStreamUrl(new StreamOptions
                {
                    Static = true,
                    ItemId = item.Id,
                    OutputFileExtension = extension,
                    AudioCodec = "copy",
                    StartTimeTicks = startTimeTicks
                });
            }

            if (item.LocationType == LocationType.Remote)
            {
                return apiClient.GetVideoStreamUrl(new VideoStreamOptions
                {
                    ItemId = item.Id,
                    OutputFileExtension = "ts",
                    VideoCodec = "h264",
                    AudioCodec = "aac"
                });
            }

            // Folder rips
            if (item.VideoType.HasValue && item.VideoType.Value != VideoType.VideoFile)
            {
                return apiClient.GetVideoStreamUrl(new VideoStreamOptions
                {
                    ItemId = item.Id,
                    OutputFileExtension = "ts",
                    VideoCodec = "h264",
                    AudioCodec = "aac"
                });
            }

            return apiClient.GetVideoStreamUrl(new VideoStreamOptions
            {
                Static = true,
                ItemId = item.Id,
                OutputFileExtension = extension
            });
        }
开发者ID:TomGillen,项目名称:MBT,代码行数:57,代码来源:PlayablePathBuilder.cs


示例20: SetBackdrops

        /// <summary>
        /// Sets the backdrop based on a BaseItemDto
        /// </summary>
        /// <param name="item">The item.</param>
        public void SetBackdrops(BaseItemDto item)
        {
            var urls = _apiClient.GetBackdropImageUrls(item, new ImageOptions
            {
                Width = Convert.ToInt32(SystemParameters.VirtualScreenWidth)
            });

            SetBackdrops(urls);
        }
开发者ID:jfrankelp,项目名称:MediaBrowser.Theater,代码行数:13,代码来源:RotatingBackdropsViewModel.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Dto.MediaSourceInfo类代码示例发布时间:2022-05-26
下一篇:
C# Dlna.DeviceIdentification类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap