public void HandleCruiserSelected(CruiserVM cruiser) { this.Tree.Initials = cruiser.Initials; //this.Tree.Save();//don't save here, let it be saved by FormDataEntryLogic this.View.Close(); }
private void MakeCruiserListItem(CruiserVM cruiser, Control parent) { Panel panel = new Panel(); panel.SuspendLayout(); Label lbl = new Label(); Button btn = new Button(); panel.BackColor = System.Drawing.Color.Tan; panel.Controls.Add(lbl); panel.Controls.Add(btn); panel.Size = new System.Drawing.Size(240, 25); panel.Dock = System.Windows.Forms.DockStyle.Top; //panel.Location = new System.Drawing.Point(0, 0); //panel.Name = "panel3"; btn.BackColor = System.Drawing.Color.Crimson; btn.Dock = System.Windows.Forms.DockStyle.Right; //this.button1.Location = new System.Drawing.Point(213, 0); //this.button1.Name = "button1"; btn.Size = new System.Drawing.Size(27, 25); btn.TabIndex = 1; btn.Text = "X"; btn.Click += new System.EventHandler(this._removeItemBTN_Click); lbl.Location = new System.Drawing.Point(12, 3); lbl.Name = "label2"; lbl.Size = new System.Drawing.Size(48, 20); lbl.Text = cruiser.Initials; panel.Tag = cruiser; panel.Parent = parent; #if NetCF FMSC.Controls.DpiHelper.AdjustControl(panel); FMSC.Controls.DpiHelper.AdjustControl(lbl); FMSC.Controls.DpiHelper.AdjustControl(btn); #endif panel.ResumeLayout(false); }
public void RemoveCruiser(CruiserVM cruiser) { this.Cruisers.Remove(cruiser); }