private void addNewTest() { if (String.IsNullOrWhiteSpace(TestName.Text)) { //TODO add warning msg return; } string newFileName = Path.Combine("CPUS\\cpu\\tests", TestName.Text + ".asm"); if (File.Exists(newFileName)) { //TODO add msg return; } File.Create(newFileName); var newTest = new Test(TestName.Text, string.Empty, newFileName, this); Tests.Add(newTest); Tests = Tests.OrderBy(t => t.Name).ToList(); TestDataGrid.ItemsSource = null; TestDataGrid.ItemsSource = Tests; TestDataGrid.SelectedItem = TestDataGrid.Items[Tests.IndexOf(newTest)]; TestDataGrid.Focus(); //TestDataGrid.GetBindingExpression(ItemsControl.ItemsSourceProperty).UpdateTarget(); }
public MainForm () { // // _dataGrid // _dataGrid = new TestDataGrid (); _dataGrid.Dock = DockStyle.Top; _dataGrid.Height = 110; Controls.Add (_dataGrid); // // _tabControl // _tabControl = new TabControl (); _tabControl.Dock = DockStyle.Bottom; _tabControl.Height = 160; Controls.Add (_tabControl); // // _bugDescriptionText1 // _bugDescriptionText1 = new TextBox (); _bugDescriptionText1.Multiline = true; _bugDescriptionText1.Dock = DockStyle.Fill; _bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture, "Steps to execute:{0}{0}" + "1. Click inside column A of the first row.{0}{0}" + "2. Press Spacebar.{0}{0}" + "Expected result:{0}{0}" + "1. The row is removed.", Environment.NewLine); // // _tabPage1 // _tabPage1 = new TabPage (); _tabPage1.Text = "#1"; _tabPage1.Controls.Add (_bugDescriptionText1); _tabControl.Controls.Add (_tabPage1); // // MainForm // ClientSize = new Size (300, 280); StartPosition = FormStartPosition.CenterScreen; Text = "bug #80465"; Load += new EventHandler (MainForm_Load); }
public MainForm () { // // _dataGrid // _dataGrid = new TestDataGrid (); _dataGrid.Dock = DockStyle.Top; _dataGrid.Height = 150; Controls.Add (_dataGrid); // // _tabControl // _tabControl = new TabControl (); _tabControl.Dock = DockStyle.Bottom; _tabControl.Height = 130; Controls.Add (_tabControl); // // _bugDescriptionText1 // _bugDescriptionText1 = new TextBox (); _bugDescriptionText1.Multiline = true; _bugDescriptionText1.Dock = DockStyle.Fill; _bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture, "Expected result on start-up:{0}{0}" + "1. The second column in the first row has focus.{0}{0}" + "2. The cursor caret is blinking.", Environment.NewLine); // // _tabPage1 // _tabPage1 = new TabPage (); _tabPage1.Text = "#1"; _tabPage1.Controls.Add (_bugDescriptionText1); _tabControl.Controls.Add (_tabPage1); // // MainForm // ClientSize = new Size (300, 290); StartPosition = FormStartPosition.CenterScreen; Text = "bug #80464"; Load += new EventHandler (MainForm_Load); }