Mode() public static method

public static Mode ( string target ) : string
target string
return string
Exemplo n.º 1
0
        public void Mode(string target, string[] newModes, string[] newModeParameters)
        {
            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }
            if (newModes == null)
            {
                throw new ArgumentNullException(nameof(newModes));
            }
            if (newModeParameters == null)
            {
                throw new ArgumentNullException(nameof(newModeParameters));
            }
            if (newModes.Length == 0)
            {
                throw new ArgumentException("newModes must not be empty.", nameof(newModes));
            }
            if (newModeParameters.Length == 0)
            {
                throw new ArgumentException("newModeParameters must not be empty.", nameof(newModeParameters));
            }
            if (newModes.Length != newModeParameters.Length)
            {
                throw new ArgumentException("newModes and newModeParameters must have the same size.", nameof(newModes));
            }

            int maxModeChanges = MaxModeChanges;

            for (int i = 0; i < newModes.Length; i += maxModeChanges)
            {
                var newModeChunks          = new List <string>(maxModeChanges);
                var newModeParameterChunks = new List <string>(maxModeChanges);
                for (int j = 0; j < maxModeChanges; j++)
                {
                    if (i + j >= newModes.Length)
                    {
                        break;
                    }
                    newModeChunks.Add(newModes[i + j]);
                    newModeParameterChunks.Add(newModeParameters[i + j]);
                }
                WriteLine(Rfc2812.Mode(target, newModeChunks.ToArray(), newModeParameterChunks.ToArray()));
            }
        }
Exemplo n.º 2
0
 public void RfcMode(string target) => WriteLine(Rfc2812.Mode(target));
Exemplo n.º 3
0
 public void RfcMode(string target, Priority priority) => WriteLine(Rfc2812.Mode(target), priority);
Exemplo n.º 4
0
 /// <summary>
 /// Fetch a list of entries of a mask-format channel mode.
 /// </summary>
 /// <param name="modetype">The type of the mask-format mode (e.g. +b) to fetch.</param>
 /// <param name="channel">The channel whose mode to fetch.</param>
 /// <param name="priority">The priority with which the mode-setting message should be sent.</param>
 public void ListChannelMasks(string modetype, string channel, Priority priority) => WriteLine(Rfc2812.Mode(channel, modetype), priority);
Exemplo n.º 5
0
 /// <summary>
 /// Add or remove an entry to/from a mask-format channel mode.
 /// </summary>
 /// <param name="modetype">The type of the mask-format mode (e.g. +b) whose entries to modify.</param>
 /// <param name="channel">The channel whose mode to edit.</param>
 /// <param name="hostmask">The hostmask of the entry to add/remove.</param>
 public void ModifyChannelMasks(string modetype, string channel, string hostmask) => WriteLine(Rfc2812.Mode(channel, modetype + " " + hostmask));
Exemplo n.º 6
0
 public void Voice(string channel, string nickname)
 {
     this.WriteLine(Rfc2812.Mode(channel, "+v " + nickname));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Fetch a list of entries of a mask-format channel mode.
 /// </summary>
 /// <param name="modetype">The type of the mask-format mode (e.g. +b) to fetch.</param>
 /// <param name="channel">The channel whose mode to fetch.</param>
 public void ListChannelMasks(string modetype, string channel) => WriteLine(Rfc2812.Mode(channel, modetype));
Exemplo n.º 8
0
 public void Deop(string channel, string nickname, Priority priority)
 {
     this.WriteLine(Rfc2812.Mode(channel, "-o " + nickname), priority);
 }
Exemplo n.º 9
0
 public void Deop(string channel, string nickname)
 {
     this.WriteLine(Rfc2812.Mode(channel, "-o " + nickname));
 }
Exemplo n.º 10
0
 public void Unban(string channel, string hostmask)
 {
     this.WriteLine(Rfc2812.Mode(channel, "-b " + hostmask));
 }
Exemplo n.º 11
0
 public void RfcMode(string target)
 {
     this.WriteLine(Rfc2812.Mode(target));
 }
Exemplo n.º 12
0
 public void Unban(string channel, string hostmask, Priority priority)
 {
     this.WriteLine(Rfc2812.Mode(channel, "-b " + hostmask), priority);
 }
Exemplo n.º 13
0
 public void Ban(string channel)
 {
     this.WriteLine(Rfc2812.Mode(channel, "+b"));
 }
Exemplo n.º 14
0
 public void Ban(string channel, Priority priority)
 {
     this.WriteLine(Rfc2812.Mode(channel, "+b"), priority);
 }
Exemplo n.º 15
0
 public void RfcMode(string target, string newmode, Priority priority) => WriteLine(Rfc2812.Mode(target, newmode), priority);
Exemplo n.º 16
0
 /// <summary>
 /// Give or take a user's privilege in a channel.
 /// </summary>
 /// <param name="modechg">The mode change (e.g. +o) to perform on the user.</param>
 /// <param name="channel">The channel in which to perform the privilege change.</param>
 /// <param name="nickname">The nickname of the user whose privilege is being changed.</param>
 public void ChangeChannelPrivilege(string modechg, string channel, string nickname) => WriteLine(Rfc2812.Mode(channel, modechg + " " + nickname));
Exemplo n.º 17
0
 public void RfcMode(string target, string newmode) => WriteLine(Rfc2812.Mode(target, newmode));
Exemplo n.º 18
0
 public void Voice(string channel, string nickname, Priority priority)
 {
     this.WriteLine(Rfc2812.Mode(channel, "+v " + nickname), priority);
 }