public Child(Order doc, ViewType viewType) : this() { // Configure the title. this.Text = doc.LastFileName; this.Document = doc; // Create a reference for the view. // This reference can accomodate any type of control. Control view = null; // Instantiate the appropriate view. switch (viewType) { case ViewType.ItemGrid: view = new OrderGridView(doc); break; case ViewType.PrintPreview: view = new OrderPrintPreview(doc); break; } // Add the view to the form. view.Dock = DockStyle.Fill; this.Controls.Add(view); }
public Child(Order doc, ViewType viewType) { InitializeComponent(); toolStrip1.Items[0].Image = imgButtons.Images[0]; toolStrip1.Items[1].Image = imgButtons.Images[1]; toolStrip1.Items[2].Image = imgButtons.Images[2]; toolStrip1.Items[3].Image = imgButtons.Images[3]; toolStrip1.Items[5].Image = imgButtons.Images[4]; // Set up window list. Program.DocumentManager.WindowListChanged += new EventHandler <WindowListChangedEventArgs>(WindowListChanged); // Configure the title. this.Text = doc.LastFileName; this.Document = doc; // Create a reference for the view. // This reference can accomodate any type of control. Control view = null; // Instantiate the appropriate view. switch (viewType) { case ViewType.ItemGrid: view = new OrderGridView(doc); break; case ViewType.PrintPreview: view = new OrderPrintPreview(doc); this.Text += " (Preview)"; toolStrip1.Visible = false; menuStrip1.Visible = false; break; } // Add the view to the form. view.Dock = DockStyle.Fill; this.Controls.Add(view); view.BringToFront(); }
public Child(Order doc, ViewType viewType) { InitializeComponent(); toolStrip1.Items[0].Image = imgButtons.Images[0]; toolStrip1.Items[1].Image = imgButtons.Images[1]; toolStrip1.Items[2].Image = imgButtons.Images[2]; toolStrip1.Items[3].Image = imgButtons.Images[3]; toolStrip1.Items[5].Image = imgButtons.Images[4]; // Set up window list. Program.DocumentManager.WindowListChanged += new EventHandler<WindowListChangedEventArgs>(WindowListChanged); // Configure the title. this.Text = doc.LastFileName; this.Document = doc; // Create a reference for the view. // This reference can accomodate any type of control. Control view = null; // Instantiate the appropriate view. switch (viewType) { case ViewType.ItemGrid: view = new OrderGridView(doc); break; case ViewType.PrintPreview: view = new OrderPrintPreview(doc); this.Text += " (Preview)"; toolStrip1.Visible = false; menuStrip1.Visible = false; break; } // Add the view to the form. view.Dock = DockStyle.Fill; this.Controls.Add(view); view.BringToFront(); }