Пример #1
0
        public void StopBroadcast(KnownMeetUp meeup, ISocketMessageChannel channel, out string msg)
        {
            msg = string.Empty;

            BroadcastMeep mub = broadcasts.SingleOrDefault(b => b.MeetUp.Name == meeup.Name && b.Channel == channel);

            if (mub == null)
            {
                msg = $"A broadcast for {meeup.Name} on {channel.Name} has not been set.";
            }
            else
            {
                mub.Live = false;
                msg      = $"The {mub.BroadcastType} broadcast for {meeup.Name} on {channel.Name} has been stopped.";
                broadcasts.Remove(mub);
            }
        }
Пример #2
0
        public void SetBroadcast(KnownMeetUp meeup, ISocketMessageChannel channel, TimeSpan frequency, MeetUpBroadCastTypeEnum type, out string msg)
        {
            msg = string.Empty;

            BroadcastMeep mub = broadcasts.SingleOrDefault(b => b.MeetUp.Name == meeup.Name && b.Channel == channel);

            if (mub == null)
            {
                broadcasts.Add(new BroadcastMeep()
                {
                    Channel = channel, MeetUp = meeup, Duration = frequency, BroadcastType = type
                });

                (new Thread(new ThreadStart(broadcasts[broadcasts.Count - 1].Broadcast))).Start();
            }
            else
            {
                msg = $"A broadcast for {meeup.Name} on {channel.Name} has already been set.";
            }
        }