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

namespace QC.QTMApplication.Dialogs;

public class LimitGroupPicker : Form
{
	private IContainer components;

	private ComboBox limitGroupComboBox;

	private Button okButton;

	private Button ignoreButton;

	public string SelectedLimitGroupName
	{
		get
		{
			if (limitGroupComboBox.SelectedItem != null)
			{
				return limitGroupComboBox.SelectedItem.ToString();
			}
			return string.Empty;
		}
	}

	public LimitGroupPicker(List<string> limitGroupNames)
	{
		InitializeComponent();
		limitGroupComboBox.DataSource = limitGroupNames;
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		this.limitGroupComboBox = new System.Windows.Forms.ComboBox();
		this.okButton = new System.Windows.Forms.Button();
		this.ignoreButton = new System.Windows.Forms.Button();
		base.SuspendLayout();
		this.limitGroupComboBox.FormattingEnabled = true;
		this.limitGroupComboBox.Location = new System.Drawing.Point(13, 13);
		this.limitGroupComboBox.Name = "limitGroupComboBox";
		this.limitGroupComboBox.Size = new System.Drawing.Size(121, 21);
		this.limitGroupComboBox.TabIndex = 0;
		this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
		this.okButton.Location = new System.Drawing.Point(140, 13);
		this.okButton.Name = "okButton";
		this.okButton.Size = new System.Drawing.Size(75, 23);
		this.okButton.TabIndex = 1;
		this.okButton.Text = "OK";
		this.okButton.UseVisualStyleBackColor = true;
		this.ignoreButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
		this.ignoreButton.Location = new System.Drawing.Point(220, 13);
		this.ignoreButton.Name = "ignoreButton";
		this.ignoreButton.Size = new System.Drawing.Size(75, 23);
		this.ignoreButton.TabIndex = 2;
		this.ignoreButton.Text = "Ignore Limits";
		this.ignoreButton.UseVisualStyleBackColor = true;
		base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.CancelButton = this.ignoreButton;
		base.ClientSize = new System.Drawing.Size(307, 45);
		base.ControlBox = false;
		base.Controls.Add(this.ignoreButton);
		base.Controls.Add(this.okButton);
		base.Controls.Add(this.limitGroupComboBox);
		base.Name = "LimitGroupPicker";
		this.Text = "Select a Limit Group";
		base.ResumeLayout(false);
	}
}
