using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Windows.Forms;

namespace QC.QTMToolKit;

public class MessageBoxWithInputAndOutputFrm : Form
{
	public string result;

	private string msgLabel;

	private string caption;

	private string okBtnLabel;

	private string cancelBtnLabel;

	private string comboValues;

	private string comments = "";

	private string imageFile;

	private IContainer components = null;

	private Label lblMessage;

	private Button btnOK;

	private Button btnCancel;

	private ComboBox comboBox1;

	private Panel panel1;

	private PictureBox pictureBox1;

	private TableLayoutPanel tableLayoutPanel1;

	public string Message
	{
		get
		{
			return msgLabel;
		}
		set
		{
			msgLabel = value;
		}
	}

	public string Caption
	{
		get
		{
			return caption;
		}
		set
		{
			caption = value;
		}
	}

	public string OKBtnLabel
	{
		get
		{
			return okBtnLabel;
		}
		set
		{
			okBtnLabel = value;
		}
	}

	public string CancelBtnLabel
	{
		set
		{
			cancelBtnLabel = value;
		}
	}

	public string ComboValues
	{
		set
		{
			comboValues = value;
		}
	}

	public string Result => result;

	public string Comments
	{
		get
		{
			return comments;
		}
		set
		{
			comments = value;
		}
	}

	public string ImageFile
	{
		get
		{
			return imageFile;
		}
		set
		{
			imageFile = value;
		}
	}

	public MessageBoxWithInputAndOutputFrm()
	{
		InitializeComponent();
	}

	private void MessageBoxWithInputAndOutput_Load(object sender, EventArgs e)
	{
		Text = caption;
		lblMessage.Text = Message;
		btnCancel.Text = cancelBtnLabel;
		btnOK.Text = okBtnLabel;
		string[] array = comboValues.Split(';');
		string[] array2 = array;
		foreach (string item in array2)
		{
			comboBox1.Items.Add(item);
		}
		if (File.Exists(imageFile))
		{
			Image image = Image.FromFile(imageFile);
			pictureBox1.Image = image;
		}
	}

	private void btnOK_Click(object sender, EventArgs e)
	{
		result = btnOK.Text;
		if (comboBox1.SelectedItem != null)
		{
			Comments = comboBox1.SelectedItem.ToString();
		}
		Close();
	}

	private void btnCancel_Click(object sender, EventArgs e)
	{
		result = btnCancel.Text;
		if (comboBox1.Text != null && comboBox1.Text.Trim() != "")
		{
			Comments = comboBox1.Text.ToString();
			Close();
		}
		else
		{
			MessageBox.Show("Make sure you have entered comments");
		}
	}

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

	private void InitializeComponent()
	{
		this.lblMessage = new System.Windows.Forms.Label();
		this.btnOK = new System.Windows.Forms.Button();
		this.btnCancel = new System.Windows.Forms.Button();
		this.comboBox1 = new System.Windows.Forms.ComboBox();
		this.panel1 = new System.Windows.Forms.Panel();
		this.pictureBox1 = new System.Windows.Forms.PictureBox();
		this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
		this.panel1.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.pictureBox1).BeginInit();
		this.tableLayoutPanel1.SuspendLayout();
		base.SuspendLayout();
		this.lblMessage.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
		this.lblMessage.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		this.lblMessage.Location = new System.Drawing.Point(192, 9);
		this.lblMessage.Name = "lblMessage";
		this.lblMessage.Size = new System.Drawing.Size(491, 136);
		this.lblMessage.TabIndex = 1;
		this.lblMessage.Text = "User Text";
		this.btnOK.AutoSize = true;
		this.btnOK.Location = new System.Drawing.Point(3, 3);
		this.btnOK.Name = "btnOK";
		this.btnOK.Size = new System.Drawing.Size(93, 21);
		this.btnOK.TabIndex = 2;
		this.btnOK.Text = "OK";
		this.btnOK.UseVisualStyleBackColor = true;
		this.btnOK.Click += new System.EventHandler(btnOK_Click);
		this.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
		this.btnCancel.AutoSize = true;
		this.btnCancel.Location = new System.Drawing.Point(395, 3);
		this.btnCancel.Name = "btnCancel";
		this.btnCancel.Size = new System.Drawing.Size(93, 21);
		this.btnCancel.TabIndex = 3;
		this.btnCancel.Text = "Cancel";
		this.btnCancel.UseVisualStyleBackColor = true;
		this.btnCancel.Click += new System.EventHandler(btnCancel_Click);
		this.comboBox1.FormattingEnabled = true;
		this.comboBox1.Location = new System.Drawing.Point(192, 148);
		this.comboBox1.Name = "comboBox1";
		this.comboBox1.Size = new System.Drawing.Size(491, 21);
		this.comboBox1.TabIndex = 4;
		this.panel1.AutoScroll = true;
		this.panel1.Controls.Add(this.pictureBox1);
		this.panel1.Location = new System.Drawing.Point(2, 3);
		this.panel1.Name = "panel1";
		this.panel1.Size = new System.Drawing.Size(173, 199);
		this.panel1.TabIndex = 5;
		this.pictureBox1.Location = new System.Drawing.Point(10, 6);
		this.pictureBox1.Name = "pictureBox1";
		this.pictureBox1.Size = new System.Drawing.Size(100, 94);
		this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
		this.pictureBox1.TabIndex = 6;
		this.pictureBox1.TabStop = false;
		this.tableLayoutPanel1.ColumnCount = 2;
		this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50f));
		this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50f));
		this.tableLayoutPanel1.Controls.Add(this.btnOK, 0, 0);
		this.tableLayoutPanel1.Controls.Add(this.btnCancel, 1, 0);
		this.tableLayoutPanel1.Location = new System.Drawing.Point(192, 175);
		this.tableLayoutPanel1.Name = "tableLayoutPanel1";
		this.tableLayoutPanel1.RowCount = 1;
		this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100f));
		this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20f));
		this.tableLayoutPanel1.Size = new System.Drawing.Size(491, 27);
		this.tableLayoutPanel1.TabIndex = 6;
		base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(693, 205);
		base.Controls.Add(this.tableLayoutPanel1);
		base.Controls.Add(this.panel1);
		base.Controls.Add(this.comboBox1);
		base.Controls.Add(this.lblMessage);
		base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
		base.MaximizeBox = false;
		base.Name = "MessageBoxWithInputAndOutputFrm";
		base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
		this.Text = "MessageBoxWithInputAndOutput";
		base.Load += new System.EventHandler(MessageBoxWithInputAndOutput_Load);
		this.panel1.ResumeLayout(false);
		this.panel1.PerformLayout();
		((System.ComponentModel.ISupportInitialize)this.pictureBox1).EndInit();
		this.tableLayoutPanel1.ResumeLayout(false);
		this.tableLayoutPanel1.PerformLayout();
		base.ResumeLayout(false);
	}
}
