private void addChannel(YoutubeChannelItem channelItem) { YoutubeChannelNodeState state = new YoutubeChannelNodeState(channelItem); YoutubeChannelNode node = new YoutubeChannelNode(state); lock (channelLock) { Children.Add(node); Properties.Settings.Default.YoutubeChannels.Add(state); } }
public YoutubeChannelNode(YoutubeChannelNodeState state) : base("pack://application:,,,/YoutubePlugin;component/Resources/Icons/channel.ico") { State = state; Name = State.Info.Snippet.Title; ChannelId = State.Info.Snippet.ChannelId; toolTip = State.Info.Snippet.Description; NrVideos = 0; Children.Add(new YoutubeChannelVideosNode(ChannelId)); Children.Add(new YoutubeChannelPlaylistsNode(ChannelId)); if (State.Statistics != null) { (Children[0] as YoutubeChannelVideosNode).NrVideos = State.Statistics.VideoCount; } }