Beispiel #1
0
 public void RemoveHandler(object sender, ReceivedChannelModeEventArgs e)
 {
     if (!e.Channel.Properties.Remove(Key))
     {
         e.Cancel();
     }
 }
Beispiel #2
0
        public void RemoveHandler(object sender, ReceivedChannelModeEventArgs e)
        {
            UserBase target = e.Channel.GetUser(e.Argument, e.User);
            if (target == null)
            {
                e.Cancel();
                return;
            }

            e.Channel.RemovePrefix(target, Prefix);
        }
Beispiel #3
0
 public void AddHandler(object sender, ReceivedChannelModeEventArgs e)
 {
     e.Channel.Properties[Key] = Parse(e.Argument);
 }
Beispiel #4
0
        private bool RemoveMode(UserBase user, ChannelModeAttribute attr, string argument)
        {
            try
            {
                ReceivedChannelModeEventArgs e = new ReceivedChannelModeEventArgs(Server, this, user, argument);
                Server.Domains.RemoveChannelModeHandlers[attr.Mode].Invoke(this, e);

                if (e.IsCanceled)
                {
                    return false;
                }
                else
                {
                    Modes.Remove(attr.Mode);
                    return true;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error removing mode {0}: {1}", ex);
                return false;
            }
        }