public static string ShowUserInputText(string label, InputBoxText.ValidateEntry validator, string title = "")
 {
     using (var input = new InputBoxText(label, validator, title))
     {
         input.ShowDialog(Instance);
         return(input.GetResult());
     }
 }
        private void ExecuteSubmitText()
        {
            Bot botInstance = Controller.Instance.GetBot(SelectedServer);

            if (botInstance != null && botInstance.Connected)
            {
                string message = InputBoxText;
                if (InputBoxText.StartsWith("/"))
                {
                    MessageType type = MessageType.Query;
                    if (SelectedLocation.StartsWith("#") || SelectedLocation.StartsWith("&"))
                    {
                        type = MessageType.Channel;
                    }
                    message = message.Remove(0, 1);
                    message = string.Join("", botInstance.ServerConfig.CommandPrefix, message);
                    botInstance.ExecuteCommand(message, SelectedLocation, type);
                }
                else
                {
                    if (SelectedLocation != " --Server-- ")
                    {
                        if (SelectedLocation.StartsWith("#") || SelectedLocation.StartsWith("&"))
                        {
                            if (botInstance.IRC.Channels.Exists(chan => chan.Name == SelectedLocation))
                            {
                                botInstance.IRC.Command.SendPrivateMessage(SelectedLocation, message);
                            }
                            else
                            {
                                AddToBuffer(SelectedServer, SelectedLocation, "You are not in this channel.");
                            }
                        }
                        else
                        {
                            botInstance.IRC.Command.SendPrivateMessage(SelectedLocation, message);
                        }
                    }
                }
                InputBoxText = string.Empty;
            }
        }