Exemple #1
0
 private static void OutputChannelSettings(LiveChannelSettings settings)
 {
     foreach (LiveChannelConfigurationElement element in settings.Channels)
     {
         Console.WriteLine("Channel Name: {0}, Account Name: {1}",
                           element.ChannelName, element.Name);
     }
 }
        /// <summary>
        /// 从配置文件中读取频道信息
        /// </summary>
        /// <returns></returns>
        private static AMSChannelCollection GetChannelsFromConfig()
        {
            MediaServiceAccountSettings accountSettings = MediaServiceAccountSettings.GetConfig();
            AMSChannelCollection        channels        = new AMSChannelCollection();

            foreach (LiveChannelConfigurationElement channelElem in LiveChannelSettings.GetConfig().Channels)
            {
                if (accountSettings.Accounts.ContainsKey(channelElem.AccountName))
                {
                    AMSChannel channel = new AMSChannel();

                    channel.ID             = UuidHelper.NewUuidString();
                    channel.Name           = channelElem.ChannelName;
                    channel.Description    = channelElem.Description;
                    channel.AMSAccountName = channelElem.AccountName;

                    channels.Add(channel);
                }
            }

            return(channels);
        }
Exemple #3
0
        public void ListConfigedChannels()
        {
            LiveChannelSettings settings = LiveChannelSettings.GetConfig();

            OutputChannelSettings(settings);
        }