Add() public method

public Add ( Channel channel ) : void
channel Channel
return void
示例#1
0
 internal void AddChannelToFavorite(ChannelFolder channelFolder, Channel[] channels)
 {
     TreeNode parentTreeNode = channelFolder.Tag as TreeNode;
     TreeNodeCollection parentTreeNodeCollection = (parentTreeNode == null ? this.treeViewChannel.Nodes : parentTreeNode.Nodes);
     foreach (Channel channel in channels)
     {
         channelFolder.Add(channel);
         parentTreeNodeCollection.Add(MakeTreeNodeFromChannel(channel));
     }
 }
示例#2
0
        internal void InsertChannels(Stream fileStream, ChannelFolder parentChannel, TreeNodeCollection parentTreeNodeCollection)
        {
            ChannelFolder channels = (ChannelFolder)Channel.Deserialize(fileStream);
            if (parentChannel == null)
                parentChannel = MainForm.rootChannelFolder;
            if (parentTreeNodeCollection == null)
                parentTreeNodeCollection = this.treeViewChannel.Nodes;

            // First level: we add to the existing folder
            // Second level: we adjust the parent
            foreach (Channel channel in channels.ChannelList)
            {
                parentChannel.Add(channel);

                TreeNode treeNode = MakeTreeNodeFromChannel(channel);

                if (channel is ChannelFolder)
                    RecursedFillTree(channel as ChannelFolder, treeNode.Nodes);

                parentTreeNodeCollection.Add(treeNode);
            }

            MainForm.UpdateChannelNumber();
        }