コード例 #1
0
ファイル: MusicContentNode.cs プロジェクト: roblans/Blu4Net
        public MusicContentNode(BluChannel channel, MusicContentNode parent, BrowseContentResponse response)
        {
            _channel = channel ?? throw new ArgumentNullException(nameof(channel));
            Parent   = parent;
            if (response == null)
            {
                throw new ArgumentNullException(nameof(response));
            }

            _searchKey  = response.SearchKey;
            ServiceName = response.ServiceName;
            Entries     = response.Items != null?response.Items.Select(element => new MusicContentEntry(channel, this, element)).ToArray() : new MusicContentEntry[0];
        }
コード例 #2
0
ファイル: MusicContentEntry.cs プロジェクト: roblans/Blu4Net
        public MusicContentEntry(BluChannel channel, MusicContentNode node, BrowseContentResponse.Item item)
        {
            _channel = channel ?? throw new ArgumentNullException(nameof(channel));
            Node     = node ?? throw new ArgumentNullException(nameof(node));

            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }

            _key     = item.BrowseKey;
            Name     = item.Text;
            Type     = !string.IsNullOrEmpty(item.Type) ? item.Type.First().ToString().ToUpper() + item.Type.Substring(1) : null;
            ImageUri = BluParser.ParseAbsoluteUri(item.Image, channel.Endpoint);
        }