Example #1
0
 /// <summary>
 /// Send a Message through the IRC Connection to the Server
 /// </summary>
 /// <param name="connection">Which Connection to use</param>
 /// <param name="data">RAW IRC Message to send</param>
 private void SendData(IRCConnection connection, string data)
 {
     if (connection != null)
     {
         if (connection.IsConnected)
         {
             if (connection.IsFullyConnected)
                 connection.SendData(data);
             else
                 //add to a command queue, which gets run once fully connected, after autoperform/autojoin
                 connection.AddToCommandQueue(data);
         }
         else
         {
             if (CurrentWindowStyle == IceTabPage.WindowType.Console)
                 WindowMessage(connection, "Console", "\x000304Error: Not Connected to Server (" + data + ")", "", true);
             else if (CurrentWindow.WindowStyle != IceTabPage.WindowType.ChannelList && CurrentWindow.WindowStyle != IceTabPage.WindowType.DCCFile)
             {
                 CurrentWindow.TextWindow.AppendText("\x000304Error: Not Connected to Server (" + data + ")", "");
                 CurrentWindow.TextWindow.ScrollToBottom();
             }
             else
             {
                 WindowMessage(connection, "Console", "\x000304Error: Not Connected to Server (" + data + ")", "", true);
             }
         }
     }
 }