using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MySQL.Utilities
{
  public partial class StringInputForm : Form
  {
    protected StringInputForm()
    {
      InitializeComponent();
    }

    public static DialogResult ShowModal(string title, string description, string prompt,
      ref string InputString)
    {
      using (StringInputForm stringInputForm = new StringInputForm())
      {
        stringInputForm.Text = title;
        if (description.Length > 0)
          stringInputForm.descLabel.Text = description;
        stringInputForm.promptLabel.Text = prompt;

        stringInputForm.inputTextBox.Text = InputString;

        DialogResult res = stringInputForm.ShowDialog();

        InputString = stringInputForm.inputTextBox.Text;
        return res;
      }
    }
  }
}