public static void Add(this PageControls pageControls, PageControlBase item, Position?position) { switch (position.GetValueOrDefault(Position.LastWithinContainer)) { case Position.FirstWithinContainer: pageControls.Insert(0, item); break; case Position.LastWithinContainer: pageControls.Add(item); break; } }
public static T AddPageControlAtPosition <T>(this PageControls pageControls, T pageControl, Position position) where T : PageControlBase { switch (position) { case Position.FirstWithinContainer: pageControls.Insert(0, pageControl); break; case Position.LastWithinContainer: pageControls.Add(pageControl); break; } return(pageControl); }
private void addControl(string strHiddenData, string strPH) { string strField; int intOrder; while (strHiddenData != "") { strField = strHiddenData.Substring(0, strHiddenData.IndexOf("&")); strHiddenData = strHiddenData.Substring(strHiddenData.IndexOf("&") + 1); intOrder = Convert.ToInt32(strField.Substring(strField.IndexOf("_") + 1)); strField = strField.Substring(0, strField.IndexOf("_")); if (strField.Substring(0, 1) == "i") { oPage.Update(Convert.ToInt32(strField.Substring(1)), strPH, Int32.Parse(lblId.Text), intOrder, 1); } else { oPage.Add(oSchema.Add(Convert.ToInt32(strField.Substring(1))), strPH, Int32.Parse(lblId.Text), intOrder, 1); } } }
protected void AddItemToInputObject(PageControlBase item, PageControls pageControls) => pageControls.Add(item, Position);
}// UserProblems internal override int InsertPropSheetPageControls() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CSecurityAdjustmentWiz3)); this.m_dg = new System.Windows.Forms.DataGrid(); this.m_lblSummary = new System.Windows.Forms.Label(); this.m_lblDes = new System.Windows.Forms.Label(); m_lblUserProblem = new System.Windows.Forms.Label(); // Set up the GUI-type stuff for the data grid this.m_dg.DataMember = ""; this.m_dg.Location = ((System.Drawing.Point)(resources.GetObject("m_dg.Location"))); this.m_dg.Size = ((System.Drawing.Size)(resources.GetObject("m_dg.Size"))); this.m_dg.TabIndex = ((int)(resources.GetObject("m_dg.TabIndex"))); m_dg.Name = "Grid"; m_dg.BackgroundColor = Color.White; // Now set up any column-specific behavioral stuff.... // like not letting the checkboxes allow null, setting // column widths, etc. DataGridTableStyle dgts = new DataGridTableStyle(); DataGridTextBoxColumn dgtbcZone = new DataGridTextBoxColumn(); DataGridTextBoxColumn dgtbcSecurityLevel = new DataGridTextBoxColumn(); m_dg.TableStyles.Add(dgts); dgts.MappingName = "Stuff"; dgts.RowHeadersVisible = false; dgts.AllowSorting = false; // Set up the column info for the Property column dgtbcZone.MappingName = "Zone"; dgtbcZone.HeaderText = CResourceStore.GetString("CSecurityAdjustmentWiz3:ZoneColumn"); dgtbcZone.ReadOnly = true; dgtbcZone.Width = ScaleWidth(CResourceStore.GetInt("CSecurityAdjustmentWiz3:ZoneColumnWidth")); dgts.GridColumnStyles.Add(dgtbcZone); // Set up the column info for the Value column dgtbcSecurityLevel.MappingName = "Security Level"; dgtbcSecurityLevel.HeaderText = CResourceStore.GetString("CSecurityAdjustmentWiz3:SecurityLevelColumn"); dgtbcSecurityLevel.Width = ScaleWidth(CResourceStore.GetInt("CSecurityAdjustmentWiz3:SecurityLevelColumnWidth")); dgts.GridColumnStyles.Add(dgtbcSecurityLevel); this.m_lblSummary.Location = ((System.Drawing.Point)(resources.GetObject("m_lblSummary.Location"))); this.m_lblSummary.Size = ((System.Drawing.Size)(resources.GetObject("m_lblSummary.Size"))); this.m_lblSummary.TabIndex = ((int)(resources.GetObject("m_lblSummary.TabIndex"))); this.m_lblSummary.Text = resources.GetString("m_lblSummary.Text"); m_lblSummary.Name = "Summary"; this.m_lblDes.Location = ((System.Drawing.Point)(resources.GetObject("m_lblDes.Location"))); this.m_lblDes.Size = ((System.Drawing.Size)(resources.GetObject("m_lblDes.Size"))); this.m_lblDes.TabIndex = ((int)(resources.GetObject("m_lblDes.TabIndex"))); this.m_lblDes.Text = resources.GetString("m_lblDes.Text"); m_lblDes.Name = "Description"; this.m_lblUserProblem.Location = ((System.Drawing.Point)(resources.GetObject("m_lblUserProblem.Location"))); this.m_lblUserProblem.Size = ((System.Drawing.Size)(resources.GetObject("m_lblUserProblem.Size"))); this.m_lblUserProblem.TabIndex = ((int)(resources.GetObject("m_lblUserProblem.TabIndex"))); this.m_lblUserProblem.Text = resources.GetString("m_lblUserProblem.Text"); m_lblUserProblem.Name = "UserProblem"; PageControls.AddRange(new System.Windows.Forms.Control[] { this.m_lblDes, this.m_dg, this.m_lblSummary, m_lblUserProblem }); // Additional UI tweaks m_dg.ReadOnly = true; m_dg.CaptionVisible = false; PageControls.Add(m_dg); CreateTable(); return(1); }// InsertPropSheetPageControls
}// CAssemVerCodebases internal override int InsertPropSheetPageControls() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CAssemVerCodebases)); this.m_lblExample4 = new System.Windows.Forms.Label(); this.m_btnDeleteEntry = new System.Windows.Forms.Button(); this.m_dg = new MyDataGrid(); this.m_lblExamples = new System.Windows.Forms.Label(); this.m_lblBindingHelp = new System.Windows.Forms.Label(); this.m_lblExample1 = new System.Windows.Forms.Label(); this.m_lblExample3 = new System.Windows.Forms.Label(); this.m_lblExample2 = new System.Windows.Forms.Label(); this.m_lblExample4.Location = ((System.Drawing.Point)(resources.GetObject("m_lblExample4.Location"))); this.m_lblExample4.Size = ((System.Drawing.Size)(resources.GetObject("m_lblExample4.Size"))); this.m_lblExample4.TabIndex = ((int)(resources.GetObject("m_lblExample4.TabIndex"))); this.m_lblExample4.Text = resources.GetString("m_lblExample4.Text"); m_lblExample4.Name = "Example4"; this.m_btnDeleteEntry.Location = ((System.Drawing.Point)(resources.GetObject("m_btnDeleteEntry.Location"))); this.m_btnDeleteEntry.Size = ((System.Drawing.Size)(resources.GetObject("m_btnDeleteEntry.Size"))); this.m_btnDeleteEntry.TabIndex = ((int)(resources.GetObject("m_btnDeleteEntry.TabIndex"))); this.m_btnDeleteEntry.Text = resources.GetString("m_btnDeleteEntry.Text"); m_btnDeleteEntry.Name = "Delete"; this.m_dg.Location = ((System.Drawing.Point)(resources.GetObject("m_dg.Location"))); this.m_dg.Size = ((System.Drawing.Size)(resources.GetObject("m_dg.Size"))); this.m_dg.TabIndex = ((int)(resources.GetObject("m_dg.TabIndex"))); m_dg.Name = "Grid"; this.m_lblExamples.Location = ((System.Drawing.Point)(resources.GetObject("m_lblExamples.Location"))); this.m_lblExamples.Size = ((System.Drawing.Size)(resources.GetObject("m_lblExamples.Size"))); this.m_lblExamples.TabIndex = ((int)(resources.GetObject("m_lblExamples.TabIndex"))); this.m_lblExamples.Text = resources.GetString("m_lblExamples.Text"); m_lblExamples.Name = "Examples"; this.m_lblBindingHelp.Location = ((System.Drawing.Point)(resources.GetObject("m_lblBindingHelp.Location"))); this.m_lblBindingHelp.Size = ((System.Drawing.Size)(resources.GetObject("m_lblBindingHelp.Size"))); this.m_lblBindingHelp.TabIndex = ((int)(resources.GetObject("m_lblBindingHelp.TabIndex"))); this.m_lblBindingHelp.Text = resources.GetString("m_lblBindingHelp.Text"); m_lblBindingHelp.Name = "BindingHelp"; this.m_lblExample1.Location = ((System.Drawing.Point)(resources.GetObject("m_lblExample1.Location"))); this.m_lblExample1.Size = ((System.Drawing.Size)(resources.GetObject("m_lblExample1.Size"))); this.m_lblExample1.TabIndex = ((int)(resources.GetObject("m_lblExample1.TabIndex"))); this.m_lblExample1.Text = resources.GetString("m_lblExample1.Text"); m_lblExample1.Name = "Example1"; this.m_lblExample3.Location = ((System.Drawing.Point)(resources.GetObject("m_lblExample3.Location"))); this.m_lblExample3.Size = ((System.Drawing.Size)(resources.GetObject("m_lblExample3.Size"))); this.m_lblExample3.TabIndex = ((int)(resources.GetObject("m_lblExample3.TabIndex"))); this.m_lblExample3.Text = resources.GetString("m_lblExample3.Text"); m_lblExample3.Name = "Example3"; this.m_lblExample2.Location = ((System.Drawing.Point)(resources.GetObject("m_lblExample2.Location"))); this.m_lblExample2.Size = ((System.Drawing.Size)(resources.GetObject("m_lblExample2.Size"))); this.m_lblExample2.TabIndex = ((int)(resources.GetObject("m_lblExample2.TabIndex"))); this.m_lblExample2.Text = resources.GetString("m_lblExample2.Text"); m_lblExample2.Name = "Example2"; PageControls.AddRange(new System.Windows.Forms.Control[] { this.m_lblExample4, this.m_lblExample3, this.m_lblExample2, this.m_lblExample1, this.m_dg, this.m_btnDeleteEntry, this.m_lblExamples, this.m_lblBindingHelp }); // ----------------- Let's build our data table -------------- // We'll create these variables just so we can use their type... // we don't need to worry about their actual values. m_dt = new DataTable("Stuff"); // Create the columns for this table DataColumn dcReqVersion = new DataColumn(); dcReqVersion.ColumnName = "Requested Version"; dcReqVersion.DataType = typeof(String); m_dt.Columns.Add(dcReqVersion); DataColumn dcURL = new DataColumn(); dcURL.ColumnName = "URI"; dcURL.DataType = typeof(String); m_dt.Columns.Add(dcURL); // Now set up any column-specific behavioral stuff.... // like not letting the checkboxes allow null, setting // column widths, etc. DataGridTableStyle dgts = new DataGridTableStyle(); DataGridTextBoxColumn dgtbcReqVer = new DataGridTextBoxColumn(); DataGridTextBoxColumn dgtbcURL = new DataGridTextBoxColumn(); m_dg.TableStyles.Add(dgts); dgts.MappingName = "Stuff"; dgts.RowHeadersVisible = false; dgts.AllowSorting = false; dgts.ReadOnly = false; // Set up the column info for the Requested Version column dgtbcReqVer.MappingName = "Requested Version"; dgtbcReqVer.HeaderText = CResourceStore.GetString("CAssemVerCodebases:RVColumn"); dgtbcReqVer.Width = ScaleWidth(CResourceStore.GetInt("CAssemVerCodebases:RVColumnWidth")); dgtbcReqVer.ReadOnly = false; dgtbcReqVer.NullText = ""; // Allows us to filter what is typed into the box dgtbcReqVer.TextBox.KeyPress += new KeyPressEventHandler(onVersionKeyPress); dgtbcReqVer.TextBox.TextChanged += new EventHandler(onChange); dgts.GridColumnStyles.Add(dgtbcReqVer); // Set up the column info for the New Version column dgtbcURL.MappingName = "URI"; dgtbcURL.HeaderText = CResourceStore.GetString("CAssemVerCodebases:URIColumn"); dgtbcURL.Width = ScaleWidth(CResourceStore.GetInt("CAssemVerCodebases:URIColumnWidth")); dgtbcURL.NullText = ""; dgtbcURL.TextBox.TextChanged += new EventHandler(onChange); dgts.GridColumnStyles.Add(dgtbcURL); m_ds = new DataSet(); m_ds.Tables.Add(m_dt); m_dg.DataSource = m_dt; m_dg.BackgroundColor = Color.White; //--------------- End Building Data Table ---------------------------- // Some UI Tweaks m_dg.ReadOnly = false; m_dg.CaptionVisible = false; PageControls.Add(m_dg); // Fill in the data PutValuesinPage(); // Set up any callbacks m_btnDeleteEntry.Click += new EventHandler(onDeleteEntireRow); m_dg.TheVertScrollBar.VisibleChanged += new EventHandler(onVisibleChange); // Allows us to enable/disable the delete button m_dg.CurrentCellChanged += new EventHandler(onCellChange); onCellChange(null, null); // See if we need to adjust the width of the headers onVisibleChange(null, null); return(1); }// InsertPropSheetPageControls
}// CGeneralMachineProps internal override int InsertPropSheetPageControls() { m_imgLine = new PictureBox(); System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CGeneralMachineProps)); this.m_pbComputer = new System.Windows.Forms.PictureBox(); this.m_lblMyComputer = new System.Windows.Forms.Label(); this.m_radConcurrent = new System.Windows.Forms.RadioButton(); this.m_radNormal = new System.Windows.Forms.RadioButton(); this.m_lblGarbageCollector = new System.Windows.Forms.Label(); this.m_lblGarbageCollectorHelp = new System.Windows.Forms.Label(); this.m_lblSecurityHelp = new System.Windows.Forms.Label(); this.m_chkUseSecurity = new System.Windows.Forms.CheckBox(); this.m_pbComputer.Location = ((System.Drawing.Point)(resources.GetObject("m_pbComputer.Location"))); this.m_pbComputer.Size = ((System.Drawing.Size)(resources.GetObject("m_pbComputer.Size"))); this.m_pbComputer.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.m_pbComputer.TabIndex = ((int)(resources.GetObject("m_pbComputer.TabIndex"))); this.m_pbComputer.TabStop = false; m_pbComputer.Name = "ComputerPicture"; this.m_lblMyComputer.Location = ((System.Drawing.Point)(resources.GetObject("m_lblMyComputer.Location"))); this.m_lblMyComputer.Size = ((System.Drawing.Size)(resources.GetObject("m_lblMyComputer.Size"))); this.m_lblMyComputer.TabIndex = ((int)(resources.GetObject("m_lblMyComputer.TabIndex"))); this.m_lblMyComputer.Text = resources.GetString("m_lblMyComputer.Text"); m_lblMyComputer.Name = "MyComputer"; this.m_radConcurrent.Location = ((System.Drawing.Point)(resources.GetObject("m_radConcurrent.Location"))); this.m_radConcurrent.Size = ((System.Drawing.Size)(resources.GetObject("m_radConcurrent.Size"))); this.m_radConcurrent.TabIndex = ((int)(resources.GetObject("m_radConcurrent.TabIndex"))); this.m_radConcurrent.Text = resources.GetString("m_radConcurrent.Text"); m_radConcurrent.Name = "Concurrent"; this.m_radNormal.Location = ((System.Drawing.Point)(resources.GetObject("m_radNormal.Location"))); this.m_radNormal.Size = ((System.Drawing.Size)(resources.GetObject("m_radNormal.Size"))); this.m_radNormal.TabIndex = ((int)(resources.GetObject("m_radNormal.TabIndex"))); this.m_radNormal.Text = resources.GetString("m_radNormal.Text"); m_radNormal.Name = "Normal"; this.m_lblGarbageCollector.Location = ((System.Drawing.Point)(resources.GetObject("m_lblGarbageCollector.Location"))); this.m_lblGarbageCollector.Size = ((System.Drawing.Size)(resources.GetObject("m_lblGarbageCollector.Size"))); this.m_lblGarbageCollector.TabIndex = ((int)(resources.GetObject("m_lblGarbageCollector.TabIndex"))); this.m_lblGarbageCollector.Text = resources.GetString("m_lblGarbageCollector.Text"); m_lblGarbageCollector.Name = "GCLabel"; this.m_lblGarbageCollectorHelp.Location = ((System.Drawing.Point)(resources.GetObject("m_lblGarbageCollectorHelp.Location"))); this.m_lblGarbageCollectorHelp.Size = ((System.Drawing.Size)(resources.GetObject("m_lblGarbageCollectorHelp.Size"))); this.m_lblGarbageCollectorHelp.TabIndex = ((int)(resources.GetObject("m_lblGarbageCollectorHelp.TabIndex"))); this.m_lblGarbageCollectorHelp.Text = resources.GetString("m_lblGarbageCollectorHelp.Text"); m_lblGarbageCollectorHelp.Name = "GCHelp"; this.m_lblSecurityHelp.Location = ((System.Drawing.Point)(resources.GetObject("m_lblSecurityHelp.Location"))); this.m_lblSecurityHelp.Size = ((System.Drawing.Size)(resources.GetObject("m_lblSecurityHelp.Size"))); this.m_lblSecurityHelp.TabIndex = ((int)(resources.GetObject("m_lblSecurityHelp.TabIndex"))); this.m_lblSecurityHelp.Text = resources.GetString("m_lblSecurityHelp.Text"); m_lblSecurityHelp.Name = "SecurityHelp"; this.m_lblSecurityHelp.Visible = false; this.m_chkUseSecurity.Location = ((System.Drawing.Point)(resources.GetObject("m_chkUseSecurity.Location"))); this.m_chkUseSecurity.Size = ((System.Drawing.Size)(resources.GetObject("m_chkUseSecurity.Size"))); this.m_chkUseSecurity.TabIndex = ((int)(resources.GetObject("m_chkUseSecurity.TabIndex"))); this.m_chkUseSecurity.Text = resources.GetString("m_chkUseSecurity.Text"); m_chkUseSecurity.Name = "UseSecurity"; this.m_chkUseSecurity.Visible = false; PageControls.AddRange(new System.Windows.Forms.Control[] { this.m_pbComputer, this.m_radNormal, this.m_radConcurrent, this.m_chkUseSecurity, this.m_lblGarbageCollector, m_lblGarbageCollectorHelp, m_lblSecurityHelp, this.m_lblMyComputer }); this.m_pbComputer.Image = Bitmap.FromHicon(CResourceStore.GetHIcon("mycomputer_ico")); // Draw a line seperating that stuff Bitmap bp = new Bitmap(370, 2); Graphics g = Graphics.FromImage(bp); g.DrawLine(Pens.Black, new Point(0, 0), new Point(370, 0)); g.DrawLine(Pens.White, new Point(0, 1), new Point(370, 1)); m_imgLine.Location = new Point(5, 60); m_imgLine.Size = new Size(370, 2); m_imgLine.TabIndex = 0; m_imgLine.TabStop = false; m_imgLine.Image = bp; PageControls.Add(m_imgLine); // Some more tweaking.... m_radNormal.CheckedChanged += new EventHandler(onChange); m_radConcurrent.CheckedChanged += new EventHandler(onChange); this.m_chkUseSecurity.CheckedChanged += new System.EventHandler(onChange); // Fill in the data PutValuesinPage(); return(1); }// InsertPropSheetPageControls