using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using MgTestAdmin.Model; using SqliteDotNet; namespace MgTestAdmin { public partial class TestResultControl : UserControl { public TestResultControl() { InitializeComponent(); } private SqliteDb _db; private TestResult _tr; private bool _frozen; public TestResultControl Setup(SqliteDb db, TestResult result, bool freeze) { _db = db; _tr = result; _frozen = freeze; if (result != null) { txtContentType.Text = result.ContentType; txtDescription.Text = result.Description; txtResult.Text = result.Result; } else { txtContentType.Text = txtDescription.Text = txtResult.Text = string.Empty; } if (_frozen) { mainToolstrip.Visible = false; txtContentType.ReadOnly = txtDescription.ReadOnly = txtResult.IsReadOnly = true; } else { mainToolstrip.Visible = true; txtContentType.ReadOnly = txtDescription.ReadOnly = txtResult.IsReadOnly = false; } return this; } } }