/// <summary> /// Instantiate the form based on an Object instance. /// </summary> /// <param name="instance_under_test">The object instance under test.</param> public EditInstanceForm(Object instance) { Debug.Assert(instance != null); Construct(instance.GetType()); smoketest_control = new MainControl(instance); smoketest_control.Dock = DockStyle.Fill; Controls.Add(smoketest_control); }
/// <summary> /// Instantiate a form for a 'type' from the 'source' assembly. /// </summary> public GetInstanceForm(Assembly[] assemblies, Assembly source, Type type) { Debug.Assert(assemblies.Length > 0); Debug.Assert(type != null); Debug.Assert(source != null); InitializeComponent(); this.type_under_test = type; this.treeTypes.Sorted = true; this.Text = "Get " + Utility.GetFriendlyTypeName(type_under_test) + " Instance"; this.comboBoxAssembly.Enabled = (assemblies.Length > 1); this.comboBoxAssembly.DataSource = assemblies; this.comboBoxAssembly.DisplayMember = "FullName"; smoketest_control = new MainControl(type_under_test); smoketest_control.Dock = DockStyle.Fill; this.tabPage1.Controls.Add(smoketest_control); smoketest_control.constructor_control.ObjectCreated += OnObjectCreated; smoketest_control.method_control.ObjectCreated += OnObjectCreated; smoketest_control.property_control.ObjectCreated += OnObjectCreated; smoketest_control.field_control.ObjectCreated += OnObjectCreated; this.comboBoxAssembly.SelectedItem = source; }