using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using QC.QTMDotNetKernel.Registry;

namespace QC.QTMDotNetKernel.Dialogs;

public class DotNetTestSelectionUI : Form
{
	internal const int IMG_ASSEMBLY = 0;

	internal const int IMG_CLASS = 1;

	internal const int IMG_METHOD = 2;

	internal const int IMG_NAMESPACE = 3;

	internal const int IMG_PROPERTY = 4;

	internal const int IMG_ARGUMENTS = 5;

	private Panel panelTests;

	private Panel panelTestTop;

	private Label lblTests;

	private Panel panelParameters;

	private Panel panelInputParam;

	private Label lblInputParam;

	private Panel panelMain;

	private Splitter splitter1;

	private Splitter splitter2;

	private Panel panelBottom;

	private Button btnOk;

	private Button btnCancel;

	private Panel panelClasses;

	private Panel panelClassesTop;

	private Label lblTestClasses;

	private Splitter splitter3;

	private Panel panelOutputParam;

	private Label lblOutputParameters;

	private TreeView treeClasses;

	private ImageList imageList;

	private TreeView treeOutputProperties;

	private TreeView treeTests;

	private TreeView treeInputProperties;

	private ToolTip toolTip;

	private StatusBar statusBar;

	private Label label1;

	private Label label3;

	private Label label2;

	private Label label6;

	private Label label4;

	private Label label5;

	private StatusBarPanel ultraStatusPanel1;

	private StatusBarPanel ultraStatusPanel2;

	private StatusBarPanel ultraStatusPanel3;

	private StatusBarPanel Namespace;

	private StatusBarPanel Class;

	private StatusBarPanel Method;

	private ContextMenuStrip contextMenuTestClass;

	private ToolStripMenuItem addAllMethodMenuItem;

	private ToolStripMenuItem addMethodMenuItem;

	private ContextMenuStrip contextMenuTests;

	private ToolStripMenuItem deleteMenuItem;

	private ToolStripMenuItem resetParamSelectMenuItem;

	private IContainer components;

	public DotNetTestSelectionUI(TestAssembly testAssembly)
	{
		InitializeComponent();
		treeClasses.Sort();
		Namespace.Icon = Icon.FromHandle(((Bitmap)imageList.Images[3]).GetHicon());
		Class.Icon = Icon.FromHandle(((Bitmap)imageList.Images[1]).GetHicon());
		Method.Icon = Icon.FromHandle(((Bitmap)imageList.Images[2]).GetHicon());
		LoadAssembly(testAssembly);
	}

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

	private void InitializeComponent()
	{
		this.components = new System.ComponentModel.Container();
		System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(QC.QTMDotNetKernel.Dialogs.DotNetTestSelectionUI));
		this.Namespace = new System.Windows.Forms.StatusBarPanel();
		this.Class = new System.Windows.Forms.StatusBarPanel();
		this.Method = new System.Windows.Forms.StatusBarPanel();
		this.panelMain = new System.Windows.Forms.Panel();
		this.panelClasses = new System.Windows.Forms.Panel();
		this.treeClasses = new System.Windows.Forms.TreeView();
		this.contextMenuTestClass = new System.Windows.Forms.ContextMenuStrip(this.components);
		this.addAllMethodMenuItem = new System.Windows.Forms.ToolStripMenuItem();
		this.addMethodMenuItem = new System.Windows.Forms.ToolStripMenuItem();
		this.imageList = new System.Windows.Forms.ImageList(this.components);
		this.panelClassesTop = new System.Windows.Forms.Panel();
		this.lblTestClasses = new System.Windows.Forms.Label();
		this.splitter1 = new System.Windows.Forms.Splitter();
		this.panelTests = new System.Windows.Forms.Panel();
		this.treeTests = new System.Windows.Forms.TreeView();
		this.contextMenuTests = new System.Windows.Forms.ContextMenuStrip(this.components);
		this.deleteMenuItem = new System.Windows.Forms.ToolStripMenuItem();
		this.resetParamSelectMenuItem = new System.Windows.Forms.ToolStripMenuItem();
		this.panelTestTop = new System.Windows.Forms.Panel();
		this.lblTests = new System.Windows.Forms.Label();
		this.splitter2 = new System.Windows.Forms.Splitter();
		this.panelParameters = new System.Windows.Forms.Panel();
		this.panelOutputParam = new System.Windows.Forms.Panel();
		this.treeOutputProperties = new System.Windows.Forms.TreeView();
		this.lblOutputParameters = new System.Windows.Forms.Label();
		this.splitter3 = new System.Windows.Forms.Splitter();
		this.panelInputParam = new System.Windows.Forms.Panel();
		this.treeInputProperties = new System.Windows.Forms.TreeView();
		this.lblInputParam = new System.Windows.Forms.Label();
		this.panelBottom = new System.Windows.Forms.Panel();
		this.label5 = new System.Windows.Forms.Label();
		this.label4 = new System.Windows.Forms.Label();
		this.label6 = new System.Windows.Forms.Label();
		this.label2 = new System.Windows.Forms.Label();
		this.label3 = new System.Windows.Forms.Label();
		this.label1 = new System.Windows.Forms.Label();
		this.btnCancel = new System.Windows.Forms.Button();
		this.statusBar = new System.Windows.Forms.StatusBar();
		this.btnOk = new System.Windows.Forms.Button();
		this.toolTip = new System.Windows.Forms.ToolTip(this.components);
		((System.ComponentModel.ISupportInitialize)this.Namespace).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.Class).BeginInit();
		((System.ComponentModel.ISupportInitialize)this.Method).BeginInit();
		this.panelMain.SuspendLayout();
		this.panelClasses.SuspendLayout();
		this.contextMenuTestClass.SuspendLayout();
		this.panelClassesTop.SuspendLayout();
		this.panelTests.SuspendLayout();
		this.contextMenuTests.SuspendLayout();
		this.panelTestTop.SuspendLayout();
		this.panelParameters.SuspendLayout();
		this.panelOutputParam.SuspendLayout();
		this.panelInputParam.SuspendLayout();
		this.panelBottom.SuspendLayout();
		base.SuspendLayout();
		this.Namespace.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
		this.Namespace.Name = "Namespace";
		this.Namespace.Width = 285;
		this.Class.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
		this.Class.Name = "Class";
		this.Class.Width = 285;
		this.Method.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
		this.Method.Name = "Method";
		this.Method.Width = 285;
		this.panelMain.BackColor = System.Drawing.SystemColors.ControlLight;
		this.panelMain.Controls.Add(this.panelClasses);
		this.panelMain.Controls.Add(this.splitter1);
		this.panelMain.Controls.Add(this.panelTests);
		this.panelMain.Controls.Add(this.splitter2);
		this.panelMain.Controls.Add(this.panelParameters);
		this.panelMain.Dock = System.Windows.Forms.DockStyle.Fill;
		this.panelMain.Location = new System.Drawing.Point(0, 0);
		this.panelMain.Name = "panelMain";
		this.panelMain.Padding = new System.Windows.Forms.Padding(5);
		this.panelMain.Size = new System.Drawing.Size(872, 587);
		this.panelMain.TabIndex = 0;
		this.panelClasses.Controls.Add(this.treeClasses);
		this.panelClasses.Controls.Add(this.panelClassesTop);
		this.panelClasses.Dock = System.Windows.Forms.DockStyle.Fill;
		this.panelClasses.Location = new System.Drawing.Point(5, 5);
		this.panelClasses.Name = "panelClasses";
		this.panelClasses.Size = new System.Drawing.Size(288, 577);
		this.panelClasses.TabIndex = 0;
		this.treeClasses.AllowDrop = true;
		this.treeClasses.ContextMenuStrip = this.contextMenuTestClass;
		this.treeClasses.Dock = System.Windows.Forms.DockStyle.Fill;
		this.treeClasses.ImageIndex = 0;
		this.treeClasses.ImageList = this.imageList;
		this.treeClasses.Location = new System.Drawing.Point(0, 16);
		this.treeClasses.Name = "treeClasses";
		this.treeClasses.PathSeparator = ".";
		this.treeClasses.SelectedImageIndex = 0;
		this.treeClasses.ShowRootLines = false;
		this.treeClasses.Size = new System.Drawing.Size(288, 561);
		this.treeClasses.TabIndex = 0;
		this.treeClasses.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(treeClasses_ItemDrag);
		this.treeClasses.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(treeClasses_AfterSelect);
		this.treeClasses.DragOver += new System.Windows.Forms.DragEventHandler(treeClasses_DragOver);
		this.treeClasses.MouseDown += new System.Windows.Forms.MouseEventHandler(treeClasses_MouseDown);
		this.contextMenuTestClass.Items.AddRange(new System.Windows.Forms.ToolStripItem[2] { this.addAllMethodMenuItem, this.addMethodMenuItem });
		this.contextMenuTestClass.Name = "contextMenuTestClass";
		this.contextMenuTestClass.Size = new System.Drawing.Size(164, 48);
		this.addAllMethodMenuItem.Name = "addAllMethodMenuItem";
		this.addAllMethodMenuItem.Size = new System.Drawing.Size(163, 22);
		this.addAllMethodMenuItem.Text = "&Add All Methods";
		this.addMethodMenuItem.Name = "addMethodMenuItem";
		this.addMethodMenuItem.Size = new System.Drawing.Size(163, 22);
		this.addMethodMenuItem.Text = "Add &Method";
		this.imageList.ImageStream = (System.Windows.Forms.ImageListStreamer)resources.GetObject("imageList.ImageStream");
		this.imageList.TransparentColor = System.Drawing.Color.Transparent;
		this.imageList.Images.SetKeyName(0, "");
		this.imageList.Images.SetKeyName(1, "");
		this.imageList.Images.SetKeyName(2, "");
		this.imageList.Images.SetKeyName(3, "");
		this.imageList.Images.SetKeyName(4, "");
		this.imageList.Images.SetKeyName(5, "");
		this.panelClassesTop.Controls.Add(this.lblTestClasses);
		this.panelClassesTop.Dock = System.Windows.Forms.DockStyle.Top;
		this.panelClassesTop.Location = new System.Drawing.Point(0, 0);
		this.panelClassesTop.Name = "panelClassesTop";
		this.panelClassesTop.Size = new System.Drawing.Size(288, 16);
		this.panelClassesTop.TabIndex = 0;
		this.lblTestClasses.BackColor = System.Drawing.Color.RoyalBlue;
		this.lblTestClasses.Dock = System.Windows.Forms.DockStyle.Fill;
		this.lblTestClasses.Font = new System.Drawing.Font("Verdana", 8.25f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
		this.lblTestClasses.ForeColor = System.Drawing.Color.White;
		this.lblTestClasses.Location = new System.Drawing.Point(0, 0);
		this.lblTestClasses.Name = "lblTestClasses";
		this.lblTestClasses.Size = new System.Drawing.Size(288, 16);
		this.lblTestClasses.TabIndex = 0;
		this.lblTestClasses.Text = "Test Classes";
		this.lblTestClasses.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
		this.splitter1.Dock = System.Windows.Forms.DockStyle.Right;
		this.splitter1.Location = new System.Drawing.Point(293, 5);
		this.splitter1.Name = "splitter1";
		this.splitter1.Size = new System.Drawing.Size(3, 577);
		this.splitter1.TabIndex = 0;
		this.splitter1.TabStop = false;
		this.panelTests.Controls.Add(this.treeTests);
		this.panelTests.Controls.Add(this.panelTestTop);
		this.panelTests.Dock = System.Windows.Forms.DockStyle.Right;
		this.panelTests.Location = new System.Drawing.Point(296, 5);
		this.panelTests.Name = "panelTests";
		this.panelTests.Size = new System.Drawing.Size(304, 577);
		this.panelTests.TabIndex = 1;
		this.treeTests.AllowDrop = true;
		this.treeTests.ContextMenuStrip = this.contextMenuTests;
		this.treeTests.Dock = System.Windows.Forms.DockStyle.Fill;
		this.treeTests.HideSelection = false;
		this.treeTests.ImageIndex = 0;
		this.treeTests.ImageList = this.imageList;
		this.treeTests.Location = new System.Drawing.Point(0, 16);
		this.treeTests.Name = "treeTests";
		this.treeTests.SelectedImageIndex = 0;
		this.treeTests.Size = new System.Drawing.Size(304, 561);
		this.treeTests.TabIndex = 0;
		this.treeTests.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(treeTests_AfterSelect);
		this.treeTests.DragDrop += new System.Windows.Forms.DragEventHandler(treeTests_DragDrop);
		this.treeTests.DragEnter += new System.Windows.Forms.DragEventHandler(treeTests_DragEnter);
		this.treeTests.DragOver += new System.Windows.Forms.DragEventHandler(treeTests_DragOver);
		this.treeTests.MouseDown += new System.Windows.Forms.MouseEventHandler(treeTests_MouseDown);
		this.treeTests.MouseMove += new System.Windows.Forms.MouseEventHandler(treeTests_MouseMove);
		this.contextMenuTests.Items.AddRange(new System.Windows.Forms.ToolStripItem[2] { this.deleteMenuItem, this.resetParamSelectMenuItem });
		this.contextMenuTests.Name = "contextMenuTestClass";
		this.contextMenuTests.Size = new System.Drawing.Size(211, 48);
		this.deleteMenuItem.Name = "deleteMenuItem";
		this.deleteMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Delete;
		this.deleteMenuItem.Size = new System.Drawing.Size(210, 22);
		this.deleteMenuItem.Text = "&Delete";
		this.resetParamSelectMenuItem.Name = "resetParamSelectMenuItem";
		this.resetParamSelectMenuItem.Size = new System.Drawing.Size(210, 22);
		this.resetParamSelectMenuItem.Text = "&Reset Parameter Selection";
		this.panelTestTop.Controls.Add(this.lblTests);
		this.panelTestTop.Dock = System.Windows.Forms.DockStyle.Top;
		this.panelTestTop.Location = new System.Drawing.Point(0, 0);
		this.panelTestTop.Name = "panelTestTop";
		this.panelTestTop.Size = new System.Drawing.Size(304, 16);
		this.panelTestTop.TabIndex = 0;
		this.lblTests.BackColor = System.Drawing.Color.RoyalBlue;
		this.lblTests.Dock = System.Windows.Forms.DockStyle.Fill;
		this.lblTests.Font = new System.Drawing.Font("Verdana", 8.25f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
		this.lblTests.ForeColor = System.Drawing.Color.White;
		this.lblTests.Location = new System.Drawing.Point(0, 0);
		this.lblTests.Name = "lblTests";
		this.lblTests.Size = new System.Drawing.Size(304, 16);
		this.lblTests.TabIndex = 0;
		this.lblTests.Text = "Tests";
		this.lblTests.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
		this.splitter2.Dock = System.Windows.Forms.DockStyle.Right;
		this.splitter2.Location = new System.Drawing.Point(600, 5);
		this.splitter2.Name = "splitter2";
		this.splitter2.Size = new System.Drawing.Size(3, 577);
		this.splitter2.TabIndex = 2;
		this.splitter2.TabStop = false;
		this.panelParameters.Controls.Add(this.panelOutputParam);
		this.panelParameters.Controls.Add(this.splitter3);
		this.panelParameters.Controls.Add(this.panelInputParam);
		this.panelParameters.Dock = System.Windows.Forms.DockStyle.Right;
		this.panelParameters.Location = new System.Drawing.Point(603, 5);
		this.panelParameters.Name = "panelParameters";
		this.panelParameters.Size = new System.Drawing.Size(264, 577);
		this.panelParameters.TabIndex = 3;
		this.panelOutputParam.Controls.Add(this.treeOutputProperties);
		this.panelOutputParam.Controls.Add(this.lblOutputParameters);
		this.panelOutputParam.Dock = System.Windows.Forms.DockStyle.Fill;
		this.panelOutputParam.Location = new System.Drawing.Point(0, 299);
		this.panelOutputParam.Name = "panelOutputParam";
		this.panelOutputParam.Size = new System.Drawing.Size(264, 278);
		this.panelOutputParam.TabIndex = 2;
		this.treeOutputProperties.AllowDrop = true;
		this.treeOutputProperties.CheckBoxes = true;
		this.treeOutputProperties.Dock = System.Windows.Forms.DockStyle.Fill;
		this.treeOutputProperties.ImageIndex = 0;
		this.treeOutputProperties.ImageList = this.imageList;
		this.treeOutputProperties.Location = new System.Drawing.Point(0, 16);
		this.treeOutputProperties.Name = "treeOutputProperties";
		this.treeOutputProperties.SelectedImageIndex = 0;
		this.treeOutputProperties.Size = new System.Drawing.Size(264, 262);
		this.treeOutputProperties.TabIndex = 0;
		this.treeOutputProperties.BeforeCheck += new System.Windows.Forms.TreeViewCancelEventHandler(treeOutputProperties_BeforeCheck);
		this.treeOutputProperties.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(treeOutputProperties_AfterCheck);
		this.treeOutputProperties.KeyPress += new System.Windows.Forms.KeyPressEventHandler(treeOutputProperties_KeyPress);
		this.treeOutputProperties.MouseMove += new System.Windows.Forms.MouseEventHandler(treeOutputProperties_MouseMove);
		this.lblOutputParameters.BackColor = System.Drawing.Color.RoyalBlue;
		this.lblOutputParameters.Dock = System.Windows.Forms.DockStyle.Top;
		this.lblOutputParameters.Font = new System.Drawing.Font("Verdana", 8.25f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
		this.lblOutputParameters.ForeColor = System.Drawing.Color.White;
		this.lblOutputParameters.Location = new System.Drawing.Point(0, 0);
		this.lblOutputParameters.Name = "lblOutputParameters";
		this.lblOutputParameters.Size = new System.Drawing.Size(264, 16);
		this.lblOutputParameters.TabIndex = 1;
		this.lblOutputParameters.Text = "Output Parameters";
		this.lblOutputParameters.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
		this.splitter3.Dock = System.Windows.Forms.DockStyle.Top;
		this.splitter3.Location = new System.Drawing.Point(0, 296);
		this.splitter3.Name = "splitter3";
		this.splitter3.Size = new System.Drawing.Size(264, 3);
		this.splitter3.TabIndex = 1;
		this.splitter3.TabStop = false;
		this.panelInputParam.Controls.Add(this.treeInputProperties);
		this.panelInputParam.Controls.Add(this.lblInputParam);
		this.panelInputParam.Dock = System.Windows.Forms.DockStyle.Top;
		this.panelInputParam.Location = new System.Drawing.Point(0, 0);
		this.panelInputParam.Name = "panelInputParam";
		this.panelInputParam.Size = new System.Drawing.Size(264, 296);
		this.panelInputParam.TabIndex = 0;
		this.treeInputProperties.AllowDrop = true;
		this.treeInputProperties.CheckBoxes = true;
		this.treeInputProperties.Dock = System.Windows.Forms.DockStyle.Fill;
		this.treeInputProperties.ImageIndex = 0;
		this.treeInputProperties.ImageList = this.imageList;
		this.treeInputProperties.Location = new System.Drawing.Point(0, 16);
		this.treeInputProperties.Name = "treeInputProperties";
		this.treeInputProperties.SelectedImageIndex = 0;
		this.treeInputProperties.Size = new System.Drawing.Size(264, 280);
		this.treeInputProperties.TabIndex = 0;
		this.treeInputProperties.BeforeCheck += new System.Windows.Forms.TreeViewCancelEventHandler(treeInputProperties_BeforeCheck);
		this.treeInputProperties.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(treeInputProperties_AfterCheck);
		this.treeInputProperties.KeyPress += new System.Windows.Forms.KeyPressEventHandler(treeInputProperties_KeyPress);
		this.treeInputProperties.MouseMove += new System.Windows.Forms.MouseEventHandler(treeInputProperties_MouseMove);
		this.lblInputParam.BackColor = System.Drawing.Color.RoyalBlue;
		this.lblInputParam.Dock = System.Windows.Forms.DockStyle.Top;
		this.lblInputParam.Font = new System.Drawing.Font("Verdana", 8.25f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
		this.lblInputParam.ForeColor = System.Drawing.Color.White;
		this.lblInputParam.Location = new System.Drawing.Point(0, 0);
		this.lblInputParam.Name = "lblInputParam";
		this.lblInputParam.Size = new System.Drawing.Size(264, 16);
		this.lblInputParam.TabIndex = 1;
		this.lblInputParam.Text = "Input Parameters";
		this.lblInputParam.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
		this.panelBottom.BackColor = System.Drawing.Color.White;
		this.panelBottom.Controls.Add(this.label5);
		this.panelBottom.Controls.Add(this.label4);
		this.panelBottom.Controls.Add(this.label6);
		this.panelBottom.Controls.Add(this.label2);
		this.panelBottom.Controls.Add(this.label3);
		this.panelBottom.Controls.Add(this.label1);
		this.panelBottom.Controls.Add(this.btnCancel);
		this.panelBottom.Controls.Add(this.statusBar);
		this.panelBottom.Controls.Add(this.btnOk);
		this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
		this.panelBottom.Location = new System.Drawing.Point(0, 587);
		this.panelBottom.Name = "panelBottom";
		this.panelBottom.Size = new System.Drawing.Size(872, 59);
		this.panelBottom.TabIndex = 1;
		this.label5.ForeColor = System.Drawing.Color.RoyalBlue;
		this.label5.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
		this.label5.ImageIndex = 4;
		this.label5.ImageList = this.imageList;
		this.label5.Location = new System.Drawing.Point(427, 3);
		this.label5.Name = "label5";
		this.label5.Size = new System.Drawing.Size(112, 23);
		this.label5.TabIndex = 14;
		this.label5.Text = "Property Parameter";
		this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
		this.label4.ForeColor = System.Drawing.Color.RoyalBlue;
		this.label4.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
		this.label4.ImageIndex = 5;
		this.label4.ImageList = this.imageList;
		this.label4.Location = new System.Drawing.Point(298, 3);
		this.label4.Name = "label4";
		this.label4.Size = new System.Drawing.Size(120, 23);
		this.label4.TabIndex = 13;
		this.label4.Text = "Argument Parameter";
		this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
		this.label6.ForeColor = System.Drawing.Color.RoyalBlue;
		this.label6.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
		this.label6.ImageIndex = 2;
		this.label6.ImageList = this.imageList;
		this.label6.Location = new System.Drawing.Point(230, 3);
		this.label6.Name = "label6";
		this.label6.Size = new System.Drawing.Size(59, 23);
		this.label6.TabIndex = 12;
		this.label6.Text = "Method";
		this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
		this.label2.ForeColor = System.Drawing.Color.RoyalBlue;
		this.label2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
		this.label2.ImageIndex = 1;
		this.label2.ImageList = this.imageList;
		this.label2.Location = new System.Drawing.Point(170, 3);
		this.label2.Name = "label2";
		this.label2.Size = new System.Drawing.Size(51, 23);
		this.label2.TabIndex = 10;
		this.label2.Text = "Class";
		this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
		this.label3.ForeColor = System.Drawing.Color.RoyalBlue;
		this.label3.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
		this.label3.ImageIndex = 0;
		this.label3.ImageList = this.imageList;
		this.label3.Location = new System.Drawing.Point(92, 3);
		this.label3.Name = "label3";
		this.label3.Size = new System.Drawing.Size(69, 23);
		this.label3.TabIndex = 9;
		this.label3.Text = "Assembly";
		this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
		this.label1.ForeColor = System.Drawing.Color.RoyalBlue;
		this.label1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
		this.label1.ImageIndex = 3;
		this.label1.ImageList = this.imageList;
		this.label1.Location = new System.Drawing.Point(2, 3);
		this.label1.Name = "label1";
		this.label1.Size = new System.Drawing.Size(81, 23);
		this.label1.TabIndex = 7;
		this.label1.Text = "Namespace";
		this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
		this.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
		this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
		this.btnCancel.Location = new System.Drawing.Point(688, 5);
		this.btnCancel.Name = "btnCancel";
		this.btnCancel.Size = new System.Drawing.Size(75, 23);
		this.btnCancel.TabIndex = 1;
		this.btnCancel.Text = "Cancel";
		this.btnCancel.UseVisualStyleBackColor = true;
		this.btnCancel.Click += new System.EventHandler(btnCancel_Click);
		this.statusBar.Location = new System.Drawing.Point(0, 36);
		this.statusBar.Name = "statusBar";
		this.statusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[3] { this.Namespace, this.Class, this.Method });
		this.statusBar.ShowPanels = true;
		this.statusBar.Size = new System.Drawing.Size(872, 23);
		this.statusBar.TabIndex = 2;
		this.btnOk.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
		this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
		this.btnOk.Location = new System.Drawing.Point(776, 5);
		this.btnOk.Name = "btnOk";
		this.btnOk.Size = new System.Drawing.Size(75, 23);
		this.btnOk.TabIndex = 0;
		this.btnOk.Text = "Ok";
		this.btnOk.UseVisualStyleBackColor = true;
		this.btnOk.Click += new System.EventHandler(btnOk_Click);
		base.AcceptButton = this.btnOk;
		this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
		this.BackColor = System.Drawing.Color.White;
		base.CancelButton = this.btnCancel;
		base.ClientSize = new System.Drawing.Size(872, 646);
		base.Controls.Add(this.panelMain);
		base.Controls.Add(this.panelBottom);
		base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
		base.Name = "DotNetTestSelectionUI";
		base.ShowIcon = false;
		base.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
		this.Text = "QSPR .Net Test Selection";
		((System.ComponentModel.ISupportInitialize)this.Namespace).EndInit();
		((System.ComponentModel.ISupportInitialize)this.Class).EndInit();
		((System.ComponentModel.ISupportInitialize)this.Method).EndInit();
		this.panelMain.ResumeLayout(false);
		this.panelClasses.ResumeLayout(false);
		this.contextMenuTestClass.ResumeLayout(false);
		this.panelClassesTop.ResumeLayout(false);
		this.panelTests.ResumeLayout(false);
		this.contextMenuTests.ResumeLayout(false);
		this.panelTestTop.ResumeLayout(false);
		this.panelParameters.ResumeLayout(false);
		this.panelOutputParam.ResumeLayout(false);
		this.panelInputParam.ResumeLayout(false);
		this.panelBottom.ResumeLayout(false);
		base.ResumeLayout(false);
	}

	private void LoadAssembly(TestAssembly testAssembly)
	{
		try
		{
			Text = Text + " - " + testAssembly.Name;
			FileInfo fileInfo = new FileInfo(testAssembly.Name);
			TreeNode treeNode = treeClasses.Nodes.Add(fileInfo.Name);
			treeNode.ImageIndex = 0;
			treeNode.SelectedImageIndex = 0;
			treeNode.Expand();
			treeNode.Tag = testAssembly;
			foreach (TestClass value in testAssembly.Classes.Values)
			{
				TreeNode treeNode2 = treeNode.Nodes.Add(value.FullName);
				treeNode2.ImageIndex = 1;
				treeNode2.SelectedImageIndex = 1;
				treeNode2.Tag = value;
				foreach (TestMethod value2 in value.Methods.Values)
				{
					TreeNode treeNode3 = treeNode2.Nodes.Add(value2.Parent.FullName + '.' + value2.Name, value2.Name);
					treeNode3.ImageIndex = 2;
					treeNode3.SelectedImageIndex = 2;
					treeNode3.Tag = value2;
					if (value2.Selected)
					{
						AddNewTest(treeNode3);
					}
				}
			}
		}
		catch
		{
		}
	}

	private void treeClasses_AfterSelect(object sender, TreeViewEventArgs e)
	{
		try
		{
			if (e.Node.Tag != null)
			{
				if (e.Node.Tag is TestAssembly)
				{
					addAllMethodMenuItem.Enabled = true;
					addAllMethodMenuItem.Visible = true;
					addMethodMenuItem.Enabled = false;
					addMethodMenuItem.Visible = false;
				}
				else if (e.Node.Tag is TestClass)
				{
					addAllMethodMenuItem.Enabled = true;
					addAllMethodMenuItem.Visible = true;
					addMethodMenuItem.Enabled = false;
					addMethodMenuItem.Visible = false;
				}
				else if (e.Node.Tag is TestMethod)
				{
					addAllMethodMenuItem.Enabled = false;
					addAllMethodMenuItem.Visible = false;
					addMethodMenuItem.Enabled = true;
					addMethodMenuItem.Visible = true;
				}
			}
		}
		catch
		{
		}
	}

	private void AddSingleMethod()
	{
		try
		{
			if (treeClasses.SelectedNode != null && treeClasses.SelectedNode.Tag is TestMethod)
			{
				AddNewTest(treeClasses.SelectedNode);
			}
		}
		catch
		{
		}
	}

	private void AddAllMethods()
	{
		try
		{
			if (treeClasses.SelectedNode == null)
			{
				return;
			}
			if (treeClasses.SelectedNode.Tag is TestAssembly)
			{
				foreach (TreeNode node in treeClasses.SelectedNode.Nodes)
				{
					AddMethod(node);
				}
				return;
			}
			if (treeClasses.SelectedNode.Tag is TestClass)
			{
				AddMethod(treeClasses.SelectedNode);
			}
		}
		catch
		{
		}
	}

	private void AddMethod(TreeNode testClassNode)
	{
		try
		{
			foreach (TreeNode node in testClassNode.Nodes)
			{
				AddNewTest(node);
			}
		}
		catch
		{
		}
	}

	private void treeClasses_ItemDrag(object sender, ItemDragEventArgs e)
	{
		try
		{
			if (e.Item is TreeNode treeNode && treeNode.Tag is TestMethod)
			{
				DoDragDrop(e.Item, DragDropEffects.Copy);
			}
		}
		catch
		{
		}
	}

	private void treeClasses_DragOver(object sender, DragEventArgs e)
	{
		e.Effect = DragDropEffects.Move;
	}

	private void treeClasses_MouseDown(object sender, MouseEventArgs e)
	{
		try
		{
			Point pt = new Point(e.X, e.Y);
			TreeNode nodeAt = treeClasses.GetNodeAt(pt);
			if (nodeAt == null)
			{
				return;
			}
			treeClasses.SelectedNode = nodeAt;
			if (e.Clicks == 2)
			{
				TreeNode treeNode = AddNewTest(nodeAt);
				if (treeNode != null)
				{
					treeTests.SelectedNode = null;
					treeClasses.SelectedNode = treeNode;
				}
			}
		}
		catch
		{
		}
	}

	private void treeTests_DragEnter(object sender, DragEventArgs e)
	{
		e.Effect = DragDropEffects.Copy;
	}

	private void treeTests_DragOver(object sender, DragEventArgs e)
	{
	}

	private void treeTests_DragDrop(object sender, DragEventArgs e)
	{
		try
		{
			TreeNode node = (TreeNode)e.Data.GetData(typeof(TreeNode));
			TreeNode treeNode = AddNewTest(node);
			if (treeNode != null)
			{
				treeTests.SelectedNode = null;
				treeTests.SelectedNode = treeNode;
			}
			treeTests.Focus();
		}
		catch
		{
		}
	}

	private void treeTests_AfterSelect(object sender, TreeViewEventArgs e)
	{
		try
		{
			treeInputProperties.Nodes.Clear();
			treeOutputProperties.Nodes.Clear();
			CreateParameterTrees(e.Node);
			SetStatus(e.Node.Name);
		}
		catch (Exception ex)
		{
			Console.WriteLine(ex.Message);
		}
	}

	private void CreateParameterTrees(TreeNode node)
	{
		try
		{
			treeInputProperties.Nodes.Clear();
			treeOutputProperties.Nodes.Clear();
			TestMethod testMethod = (TestMethod)node.Tag;
			foreach (TestParameter value in testMethod.Parameters.Values)
			{
				TreeNode treeNode = ((!(value.IOType == "Input")) ? treeOutputProperties.Nodes.Add("", value.Name) : treeInputProperties.Nodes.Add("", value.Name));
				if (value.Position == -1)
				{
					treeNode.ImageIndex = 4;
					treeNode.SelectedImageIndex = 4;
				}
				else
				{
					treeNode.ImageIndex = 5;
					treeNode.SelectedImageIndex = 5;
				}
				treeNode.Tag = value;
				treeNode.Checked = value.CheckedState == CheckState.Checked;
			}
		}
		catch
		{
		}
	}

	private void treeTests_MouseDown(object sender, MouseEventArgs e)
	{
		try
		{
			Point pt = new Point(e.X, e.Y);
			TreeNode nodeAt = treeTests.GetNodeAt(pt);
			if (nodeAt != null && e.Button == MouseButtons.Right && !nodeAt.IsSelected)
			{
				treeTests.SelectedNode = null;
				treeTests.SelectedNode = nodeAt;
			}
		}
		catch
		{
		}
	}

	private void treeTests_MouseMove(object sender, MouseEventArgs e)
	{
		try
		{
			TreeNode nodeAt = treeTests.GetNodeAt(e.X, e.Y);
			if (nodeAt != null && nodeAt.Tag != null && nodeAt.Tag is TestMethod)
			{
				if (toolTip.GetToolTip(treeTests) != nodeAt.Name)
				{
					toolTip.SetToolTip(treeTests, nodeAt.Name);
				}
				toolTip.Active = true;
			}
			else
			{
				toolTip.Active = false;
			}
		}
		catch
		{
		}
	}

	private TreeNode AddNewTest(TreeNode node)
	{
		try
		{
			if (node.Tag != null && node.Tag is TestMethod)
			{
				TestMethod testMethod = (TestMethod)node.Tag;
				testMethod.Selected = true;
				TreeNode treeNode = treeTests.Nodes[testMethod.Parent.FullName + '.' + testMethod.Name];
				if (treeNode == null)
				{
					treeNode = treeTests.Nodes.Add(testMethod.Parent.FullName + '.' + testMethod.Name, testMethod.Name);
					treeNode.ImageIndex = 2;
					treeNode.SelectedImageIndex = 2;
					treeNode.Tag = testMethod;
					treeTests.Sort();
					return treeNode;
				}
			}
		}
		catch
		{
		}
		return null;
	}

	private void SetStatus(string fullName)
	{
		try
		{
			statusBar.Panels["Namespace"].Text = "";
			statusBar.Panels["Class"].Text = "";
			statusBar.Panels["Method"].Text = "";
			string[] array = fullName.Split('.');
			if (array.Length > 2)
			{
				string text = array[array.Length - 1];
				string text2 = array[array.Length - 2];
				string text3 = fullName.Substring(0, fullName.Length - text2.Length - text.Length - 2);
				statusBar.Panels["Namespace"].Text = text3;
				statusBar.Panels["Class"].Text = text2;
				statusBar.Panels["Method"].Text = text;
			}
		}
		catch
		{
		}
	}

	private void treeInputProperties_BeforeCheck(object sender, TreeViewCancelEventArgs e)
	{
		try
		{
			if (e.Node.Checked)
			{
				TestParameter testParameter = (TestParameter)e.Node.Tag;
				if (testParameter.Position != -1)
				{
					e.Cancel = true;
				}
			}
		}
		catch
		{
		}
	}

	private void treeInputProperties_AfterCheck(object sender, TreeViewEventArgs e)
	{
		try
		{
			TestParameter testParameter = (TestParameter)e.Node.Tag;
			testParameter.CheckedState = (e.Node.Checked ? CheckState.Checked : CheckState.Unchecked);
		}
		catch
		{
		}
	}

	private void treeInputProperties_KeyPress(object sender, KeyPressEventArgs e)
	{
		try
		{
			if (e.KeyChar == ' ')
			{
				if (treeInputProperties.SelectedNode.Checked)
				{
					treeInputProperties.SelectedNode.Checked = false;
				}
				else
				{
					treeInputProperties.SelectedNode.Checked = true;
				}
			}
		}
		catch
		{
		}
	}

	private void treeInputProperties_MouseMove(object sender, MouseEventArgs e)
	{
		TreeNode nodeAt = treeInputProperties.GetNodeAt(e.X, e.Y);
		if (nodeAt != null && nodeAt.Tag != null && nodeAt.Tag is TestParameter)
		{
			TestParameter testParameter = (TestParameter)nodeAt.Tag;
			string text = "Name: " + testParameter.Name;
			text = ((testParameter.Position != -1) ? (text + "\nParameter Type: Argument") : (text + "\nParameter Type: Property"));
			if (testParameter.Value.Length > 0)
			{
				text = text + "\nValue: " + testParameter.Value;
			}
			text = text + "\nData Type: " + testParameter.DataType;
			if (testParameter.Description.Length > 0)
			{
				text = text + "\nDescription: " + testParameter.Description;
			}
			if (testParameter.UnitOfMeasure.Length > 0)
			{
				text = text + "\nUnit of Measure: " + testParameter.UnitOfMeasure;
			}
			if (testParameter.DisplayHint != 0)
			{
				text = text + "\nDisplay Hint: " + testParameter.DisplayHint;
			}
			if (testParameter.Constraints.Length > 0)
			{
				text = text + "\nConstraints: " + testParameter.Constraints;
			}
			if (toolTip.GetToolTip(treeInputProperties) != text)
			{
				toolTip.SetToolTip(treeInputProperties, text);
			}
			toolTip.Active = true;
		}
		else
		{
			toolTip.Active = false;
		}
	}

	private void treeOutputProperties_BeforeCheck(object sender, TreeViewCancelEventArgs e)
	{
		try
		{
			if (e.Node.Checked)
			{
				TestParameter testParameter = (TestParameter)e.Node.Tag;
				if (testParameter.Position != -1)
				{
					e.Cancel = true;
				}
			}
		}
		catch
		{
		}
	}

	private void treeOutputProperties_AfterCheck(object sender, TreeViewEventArgs e)
	{
		try
		{
			TestParameter testParameter = (TestParameter)e.Node.Tag;
			testParameter.CheckedState = (e.Node.Checked ? CheckState.Checked : CheckState.Unchecked);
		}
		catch
		{
		}
	}

	private void treeOutputProperties_KeyPress(object sender, KeyPressEventArgs e)
	{
		try
		{
			if (e.KeyChar == ' ')
			{
				if (treeOutputProperties.SelectedNode.Checked)
				{
					treeOutputProperties.SelectedNode.Checked = false;
				}
				else
				{
					treeOutputProperties.SelectedNode.Checked = true;
				}
			}
		}
		catch
		{
		}
	}

	private void treeOutputProperties_MouseMove(object sender, MouseEventArgs e)
	{
		try
		{
			TreeNode nodeAt = treeOutputProperties.GetNodeAt(e.X, e.Y);
			if (nodeAt != null && nodeAt.Tag != null && nodeAt.Tag is TestParameter)
			{
				TestParameter testParameter = (TestParameter)nodeAt.Tag;
				string text = "Name: " + testParameter.Name;
				text = ((testParameter.Position != -1) ? (text + "\nParameter Type: Argument") : (text + "\nParameter Type: Property"));
				if (testParameter.LowerLimit.Length > 0)
				{
					text = text + "\nLower Limit: " + testParameter.LowerLimit;
				}
				if (testParameter.UpperLimit.Length > 0)
				{
					text = text + "\nUpper Limit: " + testParameter.UpperLimit;
				}
				text = text + "\nData Type: " + testParameter.DataType;
				if (testParameter.Description.Length > 0)
				{
					text = text + "\nDescription: " + testParameter.Description;
				}
				if (testParameter.UnitOfMeasure.Length > 0)
				{
					text = text + "\nUnit of Measure: " + testParameter.UnitOfMeasure;
				}
				if (testParameter.DisplayHint != 0)
				{
					text = text + "\nDisplay Hint: " + testParameter.DisplayHint;
				}
				if (testParameter.Constraints.Length > 0)
				{
					text = text + "\nConstraints: " + testParameter.Constraints;
				}
				if (toolTip.GetToolTip(treeOutputProperties) != text)
				{
					toolTip.SetToolTip(treeOutputProperties, text);
				}
				toolTip.Active = true;
			}
			else
			{
				toolTip.Active = false;
			}
		}
		catch
		{
		}
	}

	private void btnOk_Click(object sender, EventArgs e)
	{
		Close();
	}

	private void btnCancel_Click(object sender, EventArgs e)
	{
		Close();
	}

	private void btnLegends_Click(object sender, EventArgs e)
	{
		Legends legends = new Legends();
		legends.ShowDialog();
	}

	private void contextMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
	{
		try
		{
			if (e.ClickedItem == deleteMenuItem)
			{
				DeleteTest();
			}
			else if (e.ClickedItem == resetParamSelectMenuItem)
			{
				ResetTest();
			}
			else if (e.ClickedItem == addAllMethodMenuItem)
			{
				AddAllMethods();
			}
			else if (e.ClickedItem == addMethodMenuItem)
			{
				AddSingleMethod();
			}
		}
		catch
		{
		}
	}

	private bool DeleteTest()
	{
		try
		{
			if (!treeTests.Focused)
			{
				return false;
			}
			if (treeTests.SelectedNode != null)
			{
				string text = "test";
				if (treeTests.SelectedNode != null)
				{
					text = "tests";
				}
				DialogResult dialogResult = MessageBox.Show(this, "Do you want to delete the selected " + text + "?", "QSPR - Message Center", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
				if (dialogResult == DialogResult.No)
				{
					return false;
				}
				TestMethod testMethod = (TestMethod)treeTests.SelectedNode.Tag;
				if (!testMethod.IsTestMethod)
				{
					testMethod.Selected = false;
					treeTests.Nodes.Remove(treeTests.SelectedNode);
					treeInputProperties.Nodes.Clear();
					treeOutputProperties.Nodes.Clear();
					SetStatus("");
				}
				else
				{
					MessageBox.Show(this, testMethod.Name + " cannot be deleted.\n\nHint:\n* Method has custom attributes defined.", "QSPR - Message Center", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				}
				return true;
			}
		}
		catch
		{
		}
		return false;
	}

	private bool ResetTest()
	{
		try
		{
			if (!treeTests.Focused)
			{
				return false;
			}
			if (treeTests.SelectedNode != null)
			{
				TestMethod testMethod = (TestMethod)treeTests.SelectedNode.Tag;
				testMethod.Reset();
				CreateParameterTrees(treeTests.SelectedNode);
				return true;
			}
		}
		catch
		{
		}
		return false;
	}
}
