Exemplo n.º 1
0
        }// COleDbPermControls

        protected override DataTable CreateDataTable(DataGrid dg)
        {
            DataTable dt = new DataTable("Stuff");

            // Create the "Provider" Column
            DataColumn dcProvider = new DataColumn();

            dcProvider.ColumnName = "Provider";
            dcProvider.DataType   = typeof(String);
            dt.Columns.Add(dcProvider);

            // Now set up any column-specific behavioral stuff....
            // like not letting the checkboxes allow null, setting
            // column widths, etc.

            DataGridTableStyle    dgts          = new DataGridTableStyle();
            DataGridTextBoxColumn dgtbcProvider = new DataGridTextBoxColumn();

            dg.TableStyles.Add(dgts);
            dgts.MappingName       = "Stuff";
            dgts.RowHeadersVisible = false;
            dgts.AllowSorting      = false;

            // Set up the column info for the Path column
            dgtbcProvider.MappingName          = "Provider";
            dgtbcProvider.HeaderText           = CResourceStore.GetString("Provider");
            dgtbcProvider.Width                = ScaleWidth(CResourceStore.GetInt("OleDbPermission:ProviderColumnWidth"));
            dgtbcProvider.NullText             = "";
            dgtbcProvider.TextBox.TextChanged += new EventHandler(onChange);
            dgts.GridColumnStyles.Add(dgtbcProvider);

            return(dt);
        }// CreateDataTable
Exemplo n.º 2
0
        }// CEventLogPermControls

        protected override DataTable CreateDataTable(DataGrid dg)
        {
            DataTable dt = new DataTable("Stuff");

            // Create the "Machine Name" Column
            DataColumn dcMachine = new DataColumn();

            dcMachine.ColumnName = "Machine";
            dcMachine.DataType   = typeof(String);
            dt.Columns.Add(dcMachine);

            // Create the "Access" Column
            DataColumn dcAccess = new DataColumn();

            dcAccess.ColumnName = "Access";
            dcAccess.DataType   = typeof(String);
            dt.Columns.Add(dcAccess);


            // Now set up any column-specific behavioral stuff....
            // like not letting the checkboxes allow null, setting
            // column widths, etc.

            DataGridTableStyle dgts = new DataGridTableStyle();

            DataGridTextBoxColumn       dgtbcMachine = new DataGridTextBoxColumn();
            DataGridComboBoxColumnStyle dgccAccess   = new DataGridComboBoxColumnStyle();

            dg.TableStyles.Add(dgts);
            dgts.MappingName       = "Stuff";
            dgts.RowHeadersVisible = false;
            dgts.AllowSorting      = false;

            // Set up the column info for the Machine column
            dgtbcMachine.MappingName          = "Machine";
            dgtbcMachine.HeaderText           = CResourceStore.GetString("EventLogPermission:Machine");
            dgtbcMachine.Width                = ScaleWidth(CResourceStore.GetInt("EventLogPermission:MachineColumnWidth"));
            dgtbcMachine.NullText             = "";
            dgtbcMachine.TextBox.TextChanged += new EventHandler(onChange);
            dgts.GridColumnStyles.Add(dgtbcMachine);

            // Set up the column info for the Access column
            dgccAccess.MappingName = "Access";
            dgccAccess.HeaderText  = CResourceStore.GetString("EventLogPermission:Access");
            dgccAccess.Width       = ScaleWidth(CResourceStore.GetInt("EventLogPermission:AccessColumnWidth"));
            dgccAccess.DataSource  = new DataGridComboBoxEntry[] {
                new DataGridComboBoxEntry(CResourceStore.GetString("None")),
                new DataGridComboBoxEntry(CResourceStore.GetString("EventLogPermission:Browse")),
                new DataGridComboBoxEntry(CResourceStore.GetString("EventLogPermission:Instrument")),
                new DataGridComboBoxEntry(CResourceStore.GetString("EventLogPermission:Audit"))
            };
            dgccAccess.ComboBox.SelectedIndexChanged += new EventHandler(onChange);


            dgts.GridColumnStyles.Add(dgccAccess);

            return(dt);
        }// CreateDataTable
Exemplo n.º 3
0
        }// CDirectoryServicesPermControls

        protected override DataTable CreateDataTable(DataGrid dg)
        {
            DataTable dt = new DataTable("Stuff");

            // Create the "Path" Column
            DataColumn dcPath = new DataColumn();

            dcPath.ColumnName = "Path";
            dcPath.DataType   = typeof(String);
            dt.Columns.Add(dcPath);

            // Create the "Access" Column
            DataColumn dcAccess = new DataColumn();

            dcAccess.ColumnName = "Access";
            dcAccess.DataType   = typeof(String);
            dt.Columns.Add(dcAccess);


            // Now set up any column-specific behavioral stuff....
            // like not letting the checkboxes allow null, setting
            // column widths, etc.

            DataGridTableStyle dgts = new DataGridTableStyle();

            DataGridTextBoxColumn       dgtbcPath  = new DataGridTextBoxColumn();
            DataGridComboBoxColumnStyle dgccAccess = new DataGridComboBoxColumnStyle();

            dg.TableStyles.Add(dgts);
            dgts.MappingName       = "Stuff";
            dgts.RowHeadersVisible = false;
            dgts.AllowSorting      = false;

            // Set up the column info for the Host column
            dgtbcPath.MappingName          = "Path";
            dgtbcPath.HeaderText           = CResourceStore.GetString("DirectoryServicesPermission:Path");
            dgtbcPath.Width                = ScaleWidth(CResourceStore.GetInt("DirectoryServicesPerm:PathColumnWidth"));
            dgtbcPath.NullText             = "";
            dgtbcPath.TextBox.TextChanged += new EventHandler(onChange);
            dgts.GridColumnStyles.Add(dgtbcPath);

            // Set up the column info for the Port column
            dgccAccess.MappingName = "Access";
            dgccAccess.HeaderText  = CResourceStore.GetString("DirectoryServicesPermission:Access");
            dgccAccess.NullText    = "";
            dgccAccess.Width       = ScaleWidth(CResourceStore.GetInt("DirectoryServicesPerm:AccessColumnWidth"));
            dgccAccess.DataSource  = new DataGridComboBoxEntry[] {
                new DataGridComboBoxEntry(CResourceStore.GetString("DirectoryServicesPermission:Browse")),
                new DataGridComboBoxEntry(CResourceStore.GetString("DirectoryServicesPermission:Write"))
            };
            dgccAccess.ComboBox.SelectedIndexChanged += new EventHandler(onChange);


            dgts.GridColumnStyles.Add(dgccAccess);

            return(dt);
        }// CreateDataTable
Exemplo n.º 4
0
        }// CTrustAppWiz8

        internal override int InsertPropSheetPageControls()
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CTrustAppWiz8));
            this.m_dg                   = new System.Windows.Forms.DataGrid();
            this.m_dg.Location          = ((System.Drawing.Point)(resources.GetObject("m_dg.Location")));
            this.m_dg.ReadOnly          = true;
            this.m_dg.RowHeadersVisible = false;
            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;

            PageControls.AddRange(new System.Windows.Forms.Control[] { this.m_dg });

            // Do some tweaking...
            m_dg.ReadOnly       = true;
            m_dg.CaptionVisible = false;

            // Now tell our datagrid how to display its columns
            DataGridTableStyle dgts = new DataGridTableStyle();

            dgts.MappingName       = "Stuff";
            dgts.RowHeadersVisible = false;
            dgts.AllowSorting      = false;

            m_dg.TableStyles.Add(dgts);

            String[] sColNames = new String[] { CResourceStore.GetString("CTrustAppWiz8:NameColumn"),
                                                CResourceStore.GetString("CTrustAppWiz8:ValueColumn") };

            int[] nColWidths = new int[] {
                ScaleWidth(CResourceStore.GetInt("CTrustAppWiz8:NameColumnWidth")),
                ScaleWidth(CResourceStore.GetInt("CTrustAppWiz8:ValueColumnWidth"))
            };



            for (int i = 0; i < sColNames.Length; i++)
            {
                DataGridTextBoxColumn dgtbc = new DataGridTextBoxColumn();

                // Set up the column info for the Property column
                dgtbc.MappingName = sColNames[i];
                dgtbc.HeaderText  = sColNames[i];
                dgtbc.ReadOnly    = true;
                dgtbc.Width       = nColWidths[i];
                dgts.GridColumnStyles.Add(dgtbc);
            }



            CreateTable();

            return(1);
        }// InsertPropSheetPageControls
Exemplo n.º 5
0
        }// ApplyData

        internal void onVisibleChange(Object o, EventArgs e)
        {
            if (m_dg.TheVertScrollBar.Visible)
            {
                // If the scrollbar is visible, we've lost 13 pixels
                m_dg.TableStyles[0].GridColumnStyles[1].Width = ScaleWidth(CResourceStore.GetInt("CAssemVerCodebases:URIColumnWidth")) - m_dg.TheVertScrollBar.Width;
                m_dg.Refresh();
            }
            else
            {
                m_dg.TableStyles[0].GridColumnStyles[1].Width = ScaleWidth(CResourceStore.GetInt("CAssemVerCodebases:URIColumnWidth"));
            }
        }// onVisibleChange
Exemplo n.º 6
0
        }// ApplyData

        internal void onVisibleChange(Object o, EventArgs e)
        {
            if (m_dg.TheVertScrollBar.Visible)
            {
                // We loose 13 pixels when we have a vertical scrollbar
                m_dg.TableStyles[0].GridColumnStyles[1].Width = ScaleWidth(CResourceStore.GetInt("CAssemBindPolicyProp:NVColumnWidth")) - m_dg.TheVertScrollBar.Width;
                m_dg.Refresh();
            }
            else
            {
                m_dg.TableStyles[0].GridColumnStyles[1].Width = ScaleWidth(CResourceStore.GetInt("CAssemBindPolicyProp:NVColumnWidth"));
            }
        }// onVisibleChange
Exemplo n.º 7
0
        }// onKeyPress

        internal void onVisibleChange(Object o, EventArgs e)
        {
            // See if we should shrink one of the columns
            if (m_dg.TheVertScrollBar.Visible)
            {
                // The vertical scrollbar is visible. It takes up 13 pixels
                m_dg.TableStyles[0].GridColumnStyles[1].Width = ScaleWidth(CResourceStore.GetInt("CRemotingProp3:ValueColumnWidth")) - m_dg.TheVertScrollBar.Width;
                m_dg.Refresh();
            }
            else
            {
                m_dg.TableStyles[0].GridColumnStyles[1].Width = ScaleWidth(CResourceStore.GetInt("CRemotingProp3:ValueColumnWidth"));
                m_dg.Refresh();
            }
        }// onVisibleChange
        }// 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
Exemplo n.º 9
0
        }// 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
Exemplo n.º 10
0
        }// CWebPermControls

        protected override DataTable CreateDataTable(DataGrid dg)
        {
            DataTable dt = new DataTable("Stuff");

            // Create the "Host" Column
            DataColumn dcHost = new DataColumn();

            dcHost.ColumnName = "Host";
            dcHost.DataType   = typeof(String);
            dt.Columns.Add(dcHost);

            // Create the "Accept" Column
            DataColumn dcAccept = new DataColumn();

            dcAccept.ColumnName = "Accept";
            dcAccept.DataType   = typeof(bool);
            dt.Columns.Add(dcAccept);

            // Create the "Connect" Column
            DataColumn dcConnect = new DataColumn();

            dcConnect.ColumnName = "Connect";
            dcConnect.DataType   = typeof(bool);
            dt.Columns.Add(dcConnect);

            // Now set up any column-specific behavioral stuff....
            // like not letting the checkboxes allow null, setting
            // column widths, etc.

            DataGridTableStyle dgts = new DataGridTableStyle();

            DataGridTextBoxColumn dgtbcHost   = new DataGridTextBoxColumn();
            DataGridBoolColumn    dgbcAccept  = new DataGridBoolColumn();
            DataGridBoolColumn    dgbcConnect = new DataGridBoolColumn();

            dg.TableStyles.Add(dgts);
            dgts.MappingName       = "Stuff";
            dgts.RowHeadersVisible = false;
            dgts.AllowSorting      = false;

            // Set up the column info for the Host column
            dgtbcHost.MappingName          = "Host";
            dgtbcHost.HeaderText           = CResourceStore.GetString("Host");
            dgtbcHost.Width                = ScaleWidth(CResourceStore.GetInt("WebPerm:HostColumnWidth"));
            dgtbcHost.NullText             = "";
            dgtbcHost.TextBox.TextChanged += new EventHandler(onChange);
            dgts.GridColumnStyles.Add(dgtbcHost);

            // Set up the column info for the Accept column
            dgbcAccept.MappingName       = "Accept";
            dgbcAccept.HeaderText        = CResourceStore.GetString("WebPermission:Accept");
            dgbcAccept.AllowNull         = false;
            dgbcAccept.Width             = ScaleWidth(CResourceStore.GetInt("WebPerm:AcceptColumnWidth"));
            dgbcAccept.TrueValueChanged += new EventHandler(onChange);
            dgts.GridColumnStyles.Add(dgbcAccept);

            // Set up the column info for the Connect column
            dgbcConnect.MappingName       = "Connect";
            dgbcConnect.HeaderText        = CResourceStore.GetString("WebPermission:Connect");
            dgbcConnect.AllowNull         = false;
            dgbcConnect.Width             = ScaleWidth(CResourceStore.GetInt("WebPerm:ConnectColumnWidth"));
            dgbcConnect.TrueValueChanged += new EventHandler(onChange);
            dgts.GridColumnStyles.Add(dgbcConnect);

            return(dt);
        }// CreateDataTable
Exemplo n.º 11
0
        }// CSocketPermControls

        protected override DataTable CreateDataTable(DataGrid dg)
        {
            DataTable dt = new DataTable("Stuff");

            // Create the "Host" Column
            DataColumn dcHost = new DataColumn();

            dcHost.ColumnName = "Host";
            dcHost.DataType   = typeof(String);
            dt.Columns.Add(dcHost);

            // Create the "Port" Column
            DataColumn dcPort = new DataColumn();

            dcPort.ColumnName = "Port";
            dcPort.DataType   = typeof(String);
            dt.Columns.Add(dcPort);

            // Create the "Direction" Column
            DataColumn dcDirection = new DataColumn();

            dcDirection.ColumnName = "Direction";
            dcDirection.DataType   = typeof(String);
            dt.Columns.Add(dcDirection);

            // Create the "TCP" Column
            DataColumn dcTCP = new DataColumn();

            dcTCP.ColumnName = "TCP";
            dcTCP.DataType   = typeof(bool);
            dt.Columns.Add(dcTCP);

            // Create the "UDP" Column
            DataColumn dcUDP = new DataColumn();

            dcUDP.ColumnName = "UDP";
            dcUDP.DataType   = typeof(bool);
            dt.Columns.Add(dcUDP);

            // Now set up any column-specific behavioral stuff....
            // like not letting the checkboxes allow null, setting
            // column widths, etc.

            DataGridTableStyle dgts = new DataGridTableStyle();

            DataGridTextBoxColumn       dgtbcHost     = new DataGridTextBoxColumn();
            DataGridTextBoxColumn       dgtbcPort     = new DataGridTextBoxColumn();
            DataGridComboBoxColumnStyle dgccDirection = new DataGridComboBoxColumnStyle();
            DataGridBoolColumn          dgbcTCP       = new DataGridBoolColumn();
            DataGridBoolColumn          dgbcUDP       = new DataGridBoolColumn();

            m_dg.TableStyles.Add(dgts);
            dgts.MappingName       = "Stuff";
            dgts.RowHeadersVisible = false;
            dgts.AllowSorting      = false;

            // Set up the column info for the Host column
            dgtbcHost.MappingName          = "Host";
            dgtbcHost.HeaderText           = CResourceStore.GetString("Host");
            dgtbcHost.Width                = ScaleWidth(CResourceStore.GetInt("SocketPerm:HostColumnWidth"));
            dgtbcHost.NullText             = "";
            dgtbcHost.TextBox.TextChanged += new EventHandler(onChange);
            dgts.GridColumnStyles.Add(dgtbcHost);

            // Set up the column info for the Port column
            dgtbcPort.MappingName          = "Port";
            dgtbcPort.HeaderText           = CResourceStore.GetString("SocketPermission:Port");
            dgtbcPort.NullText             = "";
            dgtbcPort.Width                = ScaleWidth(CResourceStore.GetInt("SocketPerm:PortColumnWidth"));
            dgtbcPort.TextBox.TextChanged += new EventHandler(onChange);
            dgts.GridColumnStyles.Add(dgtbcPort);

            // Set up the column info for the direction column
            dgccDirection.MappingName = "Direction";
            dgccDirection.HeaderText  = CResourceStore.GetString("SocketPermission:Direction");
            dgccDirection.Width       = ScaleWidth(CResourceStore.GetInt("SocketPerm:DirectionColumnWidth"));
            dgccDirection.DataSource  = new DataGridComboBoxEntry[] {
                new DataGridComboBoxEntry(CResourceStore.GetString("SocketPermission:Accept")),
                new DataGridComboBoxEntry(CResourceStore.GetString("SocketPermission:Connect"))
            };
            dgccDirection.ComboBox.SelectedIndexChanged += new EventHandler(onChange);


            dgts.GridColumnStyles.Add(dgccDirection);

            // Set up the column info for the TCP column
            dgbcTCP.MappingName       = "TCP";
            dgbcTCP.HeaderText        = CResourceStore.GetString("SocketPermission:TCP");
            dgbcTCP.AllowNull         = false;
            dgbcTCP.Width             = ScaleWidth(CResourceStore.GetInt("SocketPerm:TCPColumnWidth"));
            dgbcTCP.TrueValueChanged += new EventHandler(onChange);
            dgts.GridColumnStyles.Add(dgbcTCP);

            // Set up the column info for the UDP column
            dgbcUDP.MappingName       = "UDP";
            dgbcUDP.HeaderText        = CResourceStore.GetString("SocketPermission:UDP");
            dgbcUDP.AllowNull         = false;
            dgbcUDP.Width             = ScaleWidth(CResourceStore.GetInt("SocketPerm:UDPColumnWidth"));
            dgbcUDP.TrueValueChanged += new EventHandler(onChange);
            dgts.GridColumnStyles.Add(dgbcUDP);

            return(dt);
        }// CreateDataTable
Exemplo n.º 12
0
        }// CRemotingProp1

        //-------------------------------------------------
        // InsertPropSheetPageControls
        //
        // This function will create all the winforms controls
        // and parent them to the passed-in Window Handle.
        //
        // Note: For some winforms controls, such as radio buttons
        // and datagrids, we need to create a container, parent the
        // container to our window handle, and then parent our
        // winform controls to the container.
        //-------------------------------------------------
        internal override int InsertPropSheetPageControls()
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CRemotingProp1));
            this.m_lblAppLivesHere = new System.Windows.Forms.Label();
            m_lblHelp = new System.Windows.Forms.Label();
            this.m_lblWellKnownObjectsHelp = new System.Windows.Forms.Label();
            this.m_dg                               = new MyDataGrid();
            this.m_lblChooseApp                     = new System.Windows.Forms.Label();
            this.m_cbRemoteApps                     = new System.Windows.Forms.ComboBox();
            this.m_txtAppLocation                   = new System.Windows.Forms.TextBox();
            this.m_lblHelp.Location                 = ((System.Drawing.Point)(resources.GetObject("m_lblHelp.Location")));
            this.m_lblHelp.Size                     = ((System.Drawing.Size)(resources.GetObject("m_lblHelp.Size")));
            this.m_lblHelp.TabIndex                 = ((int)(resources.GetObject("m_lblHelp.TabIndex")));
            this.m_lblHelp.Text                     = resources.GetString("m_lblHelp.Text");
            m_lblHelp.Name                          = "Help";
            this.m_lblAppLivesHere.Location         = ((System.Drawing.Point)(resources.GetObject("m_lblAppLivesHere.Location")));
            this.m_lblAppLivesHere.Size             = ((System.Drawing.Size)(resources.GetObject("m_lblAppLivesHere.Size")));
            this.m_lblAppLivesHere.TabIndex         = ((int)(resources.GetObject("m_lblAppLivesHere.TabIndex")));
            this.m_lblAppLivesHere.Text             = resources.GetString("m_lblAppLivesHere.Text");
            m_lblAppLivesHere.Name                  = "AppLivesHereLabel";
            this.m_lblWellKnownObjectsHelp.Location = ((System.Drawing.Point)(resources.GetObject("m_lblWellKnownObjectsHelp.Location")));
            this.m_lblWellKnownObjectsHelp.Size     = ((System.Drawing.Size)(resources.GetObject("m_lblWellKnownObjectsHelp.Size")));
            this.m_lblWellKnownObjectsHelp.TabIndex = ((int)(resources.GetObject("m_lblWellKnownObjectsHelp.TabIndex")));
            this.m_lblWellKnownObjectsHelp.Text     = resources.GetString("m_lblWellKnownObjectsHelp.Text");
            m_lblWellKnownObjectsHelp.Name          = "WellKnownObjectsHelp";
            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_lblChooseApp.Location            = ((System.Drawing.Point)(resources.GetObject("m_lblChooseApp.Location")));
            this.m_lblChooseApp.Size                = ((System.Drawing.Size)(resources.GetObject("m_lblChooseApp.Size")));
            this.m_lblChooseApp.TabIndex            = ((int)(resources.GetObject("m_lblChooseApp.TabIndex")));
            this.m_lblChooseApp.Text                = resources.GetString("m_lblChooseApp.Text");
            m_lblChooseApp.Name                     = "ChooseApp";
            this.m_cbRemoteApps.DropDownWidth       = 328;
            this.m_cbRemoteApps.Location            = ((System.Drawing.Point)(resources.GetObject("m_cbRemoteApps.Location")));
            this.m_cbRemoteApps.Size                = ((System.Drawing.Size)(resources.GetObject("m_cbRemoteApps.Size")));
            this.m_cbRemoteApps.TabIndex            = ((int)(resources.GetObject("m_cbRemoteApps.TabIndex")));
            m_cbRemoteApps.Name                     = "RemoteApps";
            this.m_txtAppLocation.Location          = ((System.Drawing.Point)(resources.GetObject("m_txtAppLocation.Location")));
            this.m_txtAppLocation.Size              = ((System.Drawing.Size)(resources.GetObject("m_txtAppLocation.Size")));
            this.m_txtAppLocation.TabIndex          = ((int)(resources.GetObject("m_txtAppLocation.TabIndex")));
            m_txtAppLocation.Name                   = "AppLocation";
            PageControls.AddRange(new System.Windows.Forms.Control[] {
                this.m_lblWellKnownObjectsHelp,
                m_lblHelp,
                this.m_lblChooseApp,
                this.m_cbRemoteApps,
                this.m_lblAppLivesHere,
                this.m_txtAppLocation,
                this.m_dg
            });

            //---------- Build the  Data Table ----------------

            m_dt = new DataTable("Remoting");
            m_ds = new DataSet();
            m_ds.Tables.Add(m_dt);

            m_dt.DefaultView.AllowNew = false;

            // Create the "Object Name" Column
            DataColumn dcObjectName = new DataColumn();

            dcObjectName.ColumnName = "Object Name";
            dcObjectName.DataType   = typeof(String);
            m_dt.Columns.Add(dcObjectName);

            // Create the "URL" Column
            DataColumn dcKnownURL = new DataColumn();

            dcKnownURL.ColumnName = "URL";
            dcKnownURL.DataType   = typeof(String);
            m_dt.Columns.Add(dcKnownURL);

            m_dg.ReadOnly          = false;
            m_dg.CaptionVisible    = false;
            m_dg.ParentRowsVisible = false;
            m_dg.BackgroundColor   = Color.White;

            // Now set up any column-specific behavioral stuff....
            // like setting column widths, etc.

            DataGridTableStyle    dgts            = new DataGridTableStyle();
            DataGridTextBoxColumn dgtbcObjectName = new DataGridTextBoxColumn();
            DataGridTextBoxColumn dgtbcURL        = new DataGridTextBoxColumn();

            m_dg.TableStyles.Add(dgts);
            dgts.MappingName       = "Remoting";
            dgts.RowHeadersVisible = false;


            // Set up the column info for the Object Type column
            dgtbcObjectName.MappingName = "Object Name";
            dgtbcObjectName.HeaderText  = CResourceStore.GetString("CRemotingProp1:ObjectNameColumn");
            dgtbcObjectName.ReadOnly    = true;
            dgtbcObjectName.Width       = ScaleWidth(CResourceStore.GetInt("CRemotingProp1:ObjectNameColumnWidth"));
            dgts.GridColumnStyles.Add(dgtbcObjectName);

            // Set up the column info for the URL column
            dgtbcURL.MappingName          = "URL";
            dgtbcURL.HeaderText           = CResourceStore.GetString("CRemotingProp1:URLColumn");
            dgtbcURL.ReadOnly             = false;
            dgtbcURL.Width                = ScaleWidth(CResourceStore.GetInt("CRemotingProp1:URLColumnWidth"));
            dgtbcURL.TextBox.TextChanged += new EventHandler(onTextChange);

            dgts.GridColumnStyles.Add(dgtbcURL);

            m_dg.DataSource = m_dt;

            //---------- End Data Table stuff ----------------


            m_cbRemoteApps.SelectedIndexChanged += new EventHandler(onRemotingAppChange);

            // Fill in the data
            PutValuesinPage();

            // Now finally hook up this event handler

            m_txtAppLocation.TextChanged += new EventHandler(onTextChange);
            return(1);
        }// InsertPropSheetPageControls
Exemplo n.º 13
0
        }// PutValuesinPage

        void onRemotingAppChange(Object o, EventArgs e)
        {
            if (m_cbRemoteApps.SelectedIndex != -1)
            {
                if (m_nPrevSelection != -1 && m_nPrevSelection != m_cbRemoteApps.SelectedIndex)
                {
                    // Check these values first
                    if (!ValidateData(m_nPrevSelection))
                    {
                        m_cbRemoteApps.SelectedIndex = m_nPrevSelection;
                        return;
                    }
                }

                RemotingApplicationInfo rai;

                if (m_nPrevSelection != -1)
                {
                    rai = (RemotingApplicationInfo)m_alRemotingAppInfo[m_nPrevSelection];

                    // Capture the changes the user made to the URL

                    rai.sURL = m_txtAppLocation.Text;

                    for (int i = 0; i < rai.scWellKnownURL.Count; i++)
                    {
                        rai.scWellKnownURL[i] = (String)m_dt.Rows[i]["URL"];
                    }
                }
                m_fWatchChange = false;
                m_dt.Clear();


                rai = (RemotingApplicationInfo)m_alRemotingAppInfo[m_cbRemoteApps.SelectedIndex];

                // Put in the application's location
                m_txtAppLocation.Text = rai.sURL;

                DataRow newRow;

                // Now build the Well Known objects table
                for (int i = 0; i < rai.scWellKnownObjectType.Count; i++)
                {
                    newRow = m_dt.NewRow();
                    String sName = rai.scWellKnownObjectType[i];
                    if (sName == null || sName.Length == 0)
                    {
                        sName = CResourceStore.GetString("Unnamed");
                    }

                    newRow["Object Name"] = sName;
                    newRow["URL"]         = rai.scWellKnownURL[i];
                    m_dt.Rows.Add(newRow);
                }
            }
            m_nPrevSelection = m_cbRemoteApps.SelectedIndex;
            m_fWatchChange   = true;

            // See if we should shrink one of the columns
            if (m_dg.TheVertScrollBar.Visible)
            {
                // The vertical scrollbar is visible. It takes up 13 pixels
                m_dg.TableStyles[0].GridColumnStyles[1].Width = ScaleWidth(CResourceStore.GetInt("CRemotingProp1:URLColumnWidth")) - m_dg.TheVertScrollBar.Width;
            }
            else
            {
                m_dg.TableStyles[0].GridColumnStyles[1].Width = ScaleWidth(CResourceStore.GetInt("CRemotingProp1:URLColumnWidth"));
            }
        }// onRemotingAppChange
Exemplo n.º 14
0
        }// CRemotingProp2

        //-------------------------------------------------
        // InsertPropSheetPageControls
        //
        // This function will create all the winforms controls
        // and parent them to the passed-in Window Handle.
        //
        // Note: For some winforms controls, such as radio buttons
        // and datagrids, we need to create a container, parent the
        // container to our window handle, and then parent our
        // winform controls to the container.
        //-------------------------------------------------
        internal override int InsertPropSheetPageControls()
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CRemotingProp2));
            this.m_lblObjectURIs           = new System.Windows.Forms.Label();
            this.m_dgObjectURIs            = new MyDataGrid();
            this.m_lblObjectURIs.Location  = ((System.Drawing.Point)(resources.GetObject("m_lblObjectURIs.Location")));
            this.m_lblObjectURIs.Size      = ((System.Drawing.Size)(resources.GetObject("m_lblObjectURIs.Size")));
            this.m_lblObjectURIs.TabIndex  = ((int)(resources.GetObject("m_lblObjectURIs.TabIndex")));
            this.m_lblObjectURIs.Text      = resources.GetString("m_lblObjectURIs.Text");
            m_lblObjectURIs.Name           = "ObjectURILabel";
            this.m_dgObjectURIs.Location   = ((System.Drawing.Point)(resources.GetObject("m_dgObjectURIs.Location")));
            this.m_dgObjectURIs.Size       = ((System.Drawing.Size)(resources.GetObject("m_dgObjectURIs.Size")));
            this.m_dgObjectURIs.TabIndex   = ((int)(resources.GetObject("m_dgObjectURIs.TabIndex")));
            m_dgObjectURIs.Name            = "Grid";
            m_dgObjectURIs.BackgroundColor = Color.White;

            PageControls.AddRange(new System.Windows.Forms.Control[] { this.m_dgObjectURIs,
                                                                       this.m_lblObjectURIs });

            //---------- Begin Object URI table ----------------
            // Build the first data table


            m_dtObjectURIs = new DataTable("ObjectURIs");
            m_ds           = new DataSet();
            m_ds.Tables.Add(m_dtObjectURIs);
            m_dtObjectURIs.DefaultView.AllowNew = false;

            // Create the "Object Name" Column
            DataColumn dcKnownOName = new DataColumn();

            dcKnownOName.ColumnName = "Object Name";
            dcKnownOName.DataType   = typeof(String);
            m_dtObjectURIs.Columns.Add(dcKnownOName);

            // Create the "URI" Column
            DataColumn dcKnownURI = new DataColumn();

            dcKnownURI.ColumnName = "URI";
            dcKnownURI.DataType   = typeof(String);
            m_dtObjectURIs.Columns.Add(dcKnownURI);

            // Set up the GUI-type stuff for the data grid
            m_dgObjectURIs.ReadOnly          = false;
            m_dgObjectURIs.CaptionVisible    = false;
            m_dgObjectURIs.ParentRowsVisible = false;

            // Now set up any column-specific behavioral stuff....
            // like setting column widths, etc.

            DataGridTableStyle    dgtsKnown       = new DataGridTableStyle();
            DataGridTextBoxColumn dgtbcKnownOName = new DataGridTextBoxColumn();
            DataGridTextBoxColumn dgtbcKnownURI   = new DataGridTextBoxColumn();

            m_dgObjectURIs.TableStyles.Add(dgtsKnown);
            dgtsKnown.MappingName       = "ObjectURIs";
            dgtsKnown.RowHeadersVisible = false;
            dgtsKnown.AllowSorting      = false;
            dgtsKnown.ReadOnly          = false;

            // Set up the column info for the Object Type column
            dgtbcKnownOName.MappingName = "Object Name";
            dgtbcKnownOName.HeaderText  = CResourceStore.GetString("CRemotingProp2:ObjectNameColumn");
            dgtbcKnownOName.ReadOnly    = true;
            dgtbcKnownOName.Width       = ScaleWidth(CResourceStore.GetInt("CRemotingProp2:ObjectNameColumnWidth"));
            dgtsKnown.GridColumnStyles.Add(dgtbcKnownOName);

            // Set up the column info for the URI column
            dgtbcKnownURI.MappingName          = "URI";
            dgtbcKnownURI.HeaderText           = CResourceStore.GetString("CRemotingProp2:URIColumn");
            dgtbcKnownURI.ReadOnly             = false;
            dgtbcKnownURI.Width                = ScaleWidth(CResourceStore.GetInt("CRemotingProp2:URIColumnWidth"));
            dgtbcKnownURI.TextBox.TextChanged += new EventHandler(onChange);

            dgtsKnown.GridColumnStyles.Add(dgtbcKnownURI);

            m_dgObjectURIs.DataSource = m_dtObjectURIs;

            //---------- End Data Table2 ----------------


            // Fill in the data
            PutValuesinPage();

            // See if we should shrink one of the columns
            if (m_dgObjectURIs.TheVertScrollBar.Visible)
            {
                // The vertical scrollbar is visible. It takes up 13 pixels
                m_dgObjectURIs.TableStyles[0].GridColumnStyles[1].Width -= m_dgObjectURIs.TheVertScrollBar.Width;
            }

            return(1);
        }// InsertPropSheetPageControls
Exemplo n.º 15
0
        }// CRegPermControls

        protected override DataTable CreateDataTable(DataGrid dg)
        {
            DataTable dt = new DataTable("Stuff");

            // Create the "Key" Column
            DataColumn dcKey = new DataColumn();

            dcKey.ColumnName = "Key";
            dcKey.DataType   = typeof(String);
            dt.Columns.Add(dcKey);

            // Create the "Read" Column
            DataColumn dcRead = new DataColumn();

            dcRead.ColumnName = "Read";
            dcRead.DataType   = typeof(bool);
            dt.Columns.Add(dcRead);


            // Create the "Write" Column
            DataColumn dcWrite = new DataColumn();

            dcWrite.ColumnName = "Write";
            dcWrite.DataType   = typeof(bool);
            dt.Columns.Add(dcWrite);

            // Create the "Create" Column
            DataColumn dcAppend = new DataColumn();

            dcAppend.ColumnName = "Create";
            dcAppend.DataType   = typeof(bool);
            dt.Columns.Add(dcAppend);


            // Now set up any column-specific behavioral stuff....
            // like not letting the checkboxes allow null, setting
            // column widths, etc.

            DataGridTableStyle    dgts       = new DataGridTableStyle();
            DataGridBoolColumn    dgbcRead   = new DataGridBoolColumn();
            DataGridBoolColumn    dgbcWrite  = new DataGridBoolColumn();
            DataGridBoolColumn    dgbcCreate = new DataGridBoolColumn();
            DataGridTextBoxColumn dgtbcKey   = new DataGridTextBoxColumn();

            dg.TableStyles.Add(dgts);
            dgts.MappingName       = "Stuff";
            dgts.RowHeadersVisible = false;
            dgts.AllowSorting      = false;

            // Set up the column info for the Path column
            dgtbcKey.MappingName          = "Key";
            dgtbcKey.HeaderText           = CResourceStore.GetString("Key");
            dgtbcKey.Width                = ScaleWidth(CResourceStore.GetInt("RegPerm:KeyColumnWidth"));
            dgtbcKey.NullText             = "";
            dgtbcKey.TextBox.TextChanged += new EventHandler(onChange);
            dgts.GridColumnStyles.Add(dgtbcKey);

            // Set up the column info for the Read column
            dgbcRead.MappingName       = "Read";
            dgbcRead.HeaderText        = CResourceStore.GetString("RegistryPermission:Read");
            dgbcRead.AllowNull         = false;
            dgbcRead.Width             = ScaleWidth(CResourceStore.GetInt("RegPerm:ReadColumnWidth"));
            dgbcRead.TrueValueChanged += new EventHandler(onChange);
            dgts.GridColumnStyles.Add(dgbcRead);

            // Set up the column info for the Write column
            dgbcWrite.MappingName       = "Write";
            dgbcWrite.HeaderText        = CResourceStore.GetString("RegistryPermission:Write");
            dgbcWrite.AllowNull         = false;
            dgbcWrite.Width             = ScaleWidth(CResourceStore.GetInt("RegPerm:WriteColumnWidth"));
            dgbcWrite.TrueValueChanged += new EventHandler(onChange);
            dgts.GridColumnStyles.Add(dgbcWrite);

            // Set up the column info for the Append column
            dgbcCreate.MappingName       = "Create";
            dgbcCreate.HeaderText        = CResourceStore.GetString("RegistryPermission:Create");
            dgbcCreate.AllowNull         = false;
            dgbcCreate.Width             = ScaleWidth(CResourceStore.GetInt("RegPerm:CreateColumnWidth"));
            dgbcCreate.TrueValueChanged += new EventHandler(onChange);
            dgts.GridColumnStyles.Add(dgbcCreate);

            return(dt);
        }
Exemplo n.º 16
0
        }// CRemotingProp3

        //-------------------------------------------------
        // InsertPropSheetPageControls
        //
        // This function will create all the winforms controls
        // and parent them to the passed-in Window Handle.
        //
        // Note: For some winforms controls, such as radio buttons
        // and datagrids, we need to create a container, parent the
        // container to our window handle, and then parent our
        // winform controls to the container.
        //-------------------------------------------------
        internal override int InsertPropSheetPageControls()
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CRemotingProp3));
            this.m_cbChannel        = new System.Windows.Forms.ComboBox();
            this.m_lblGenHelp       = new System.Windows.Forms.Label();
            this.m_lblHelp          = new System.Windows.Forms.Label();
            this.m_lblChooseChannel = new System.Windows.Forms.Label();
            this.m_dg = new MyDataGrid();
            this.m_cbChannel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.m_cbChannel.DropDownWidth = 152;
            this.m_cbChannel.Location      = ((System.Drawing.Point)(resources.GetObject("m_cbChannel.Location")));
            this.m_cbChannel.Size          = ((System.Drawing.Size)(resources.GetObject("m_cbChannel.Size")));
            this.m_cbChannel.TabIndex      = ((int)(resources.GetObject("m_cbChannel.TabIndex")));
            m_cbChannel.Name                 = "Channels";
            this.m_lblGenHelp.Location       = ((System.Drawing.Point)(resources.GetObject("m_lblGenHelp.Location")));
            this.m_lblGenHelp.Size           = ((System.Drawing.Size)(resources.GetObject("m_lblGenHelp.Size")));
            this.m_lblGenHelp.TabIndex       = ((int)(resources.GetObject("m_lblGenHelp.TabIndex")));
            this.m_lblGenHelp.Text           = resources.GetString("m_lblGenHelp.Text");
            m_lblGenHelp.Name                = "GeneralHelp";
            this.m_lblHelp.Location          = ((System.Drawing.Point)(resources.GetObject("m_lblHelp.Location")));
            this.m_lblHelp.Size              = ((System.Drawing.Size)(resources.GetObject("m_lblHelp.Size")));
            this.m_lblHelp.TabIndex          = ((int)(resources.GetObject("m_lblHelp.TabIndex")));
            this.m_lblHelp.Text              = resources.GetString("m_lblHelp.Text");
            m_lblHelp.Name                   = "Help";
            this.m_lblChooseChannel.Location = ((System.Drawing.Point)(resources.GetObject("m_lblChooseChannel.Location")));
            this.m_lblChooseChannel.Size     = ((System.Drawing.Size)(resources.GetObject("m_lblChooseChannel.Size")));
            this.m_lblChooseChannel.TabIndex = ((int)(resources.GetObject("m_lblChooseChannel.TabIndex")));
            this.m_lblChooseChannel.Text     = resources.GetString("m_lblChooseChannel.Text");
            m_lblChooseChannel.Name          = "ChooseChannel";
            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;

            PageControls.AddRange(new System.Windows.Forms.Control[] { this.m_dg,
                                                                       this.m_lblHelp,
                                                                       m_lblGenHelp,
                                                                       this.m_lblChooseChannel,
                                                                       this.m_cbChannel });

            //---------- Begin Data Table ----------------
            m_dt = new DataTable("Attributes");
            m_ds = new DataSet();
            m_ds.Tables.Add(m_dt);

            m_dt.DefaultView.AllowNew = false;

            // Create the "Attribute" Column
            DataColumn dcAttribute = new DataColumn();

            dcAttribute.ColumnName = "Attribute";
            dcAttribute.DataType   = typeof(String);
            m_dt.Columns.Add(dcAttribute);

            // Create the "Value" Column
            DataColumn dcValue = new DataColumn();

            dcValue.ColumnName = "Value";
            dcValue.DataType   = typeof(String);
            m_dt.Columns.Add(dcValue);

            // Now set up any column-specific behavioral stuff....
            // like setting column widths, etc.

            DataGridTableStyle    dgtsAct        = new DataGridTableStyle();
            DataGridTextBoxColumn dgtbcAttribute = new DataGridTextBoxColumn();
            DataGridTextBoxColumn dgtbcValue     = new DataGridTextBoxColumn();

            m_dg.TableStyles.Add(dgtsAct);
            dgtsAct.MappingName       = "Attributes";
            dgtsAct.RowHeadersVisible = false;
            dgtsAct.AllowSorting      = false;
            dgtsAct.ReadOnly          = false;

            // Set up the column info for the Object Type column
            dgtbcAttribute.MappingName = "Attribute";
            dgtbcAttribute.HeaderText  = CResourceStore.GetString("CRemotingProp3:AttributeColumn");
            dgtbcAttribute.ReadOnly    = true;
            dgtbcAttribute.Width       = ScaleWidth(CResourceStore.GetInt("CRemotingProp3:AttributeColumnWidth"));
            dgtbcAttribute.NullText    = "";

            dgtsAct.GridColumnStyles.Add(dgtbcAttribute);

            // Set up the column info for the value column
            dgtbcValue.MappingName          = "Value";
            dgtbcValue.HeaderText           = CResourceStore.GetString("CRemotingProp3:ValueColumn");
            dgtbcValue.ReadOnly             = false;
            dgtbcValue.Width                = ScaleWidth(CResourceStore.GetInt("CRemotingProp3:ValueColumnWidth"));
            dgtbcValue.NullText             = "";
            dgtbcValue.TextBox.TextChanged += new EventHandler(onChange);


            dgtsAct.GridColumnStyles.Add(dgtbcValue);

            m_dg.DataSource = m_dt;
            //---------- End Data Table ----------------

            // Fill in the data
            PutValuesinPage();

            // Do some UI tweaks
            m_dg.ReadOnly          = false;
            m_dg.CaptionVisible    = false;
            m_dg.ParentRowsVisible = false;

            // Now finally hook up event handlers
            m_cbChannel.SelectedIndexChanged     += new EventHandler(onChannelChange);
            m_dg.TheVertScrollBar.VisibleChanged += new EventHandler(onVisibleChange);

            return(1);
        }// InsertPropSheetPageControls
Exemplo n.º 17
0
        }// CreateDataTable

        //-------------------------------------------------
        // CreateOtherDataTable
        //
        // Creates the datatable for the Other table
        //-------------------------------------------------
        private DataTable CreateOtherDataTable(DataGrid dg)
        {
            DataTable dt = new DataTable("Other");

            // Create the "Machine Name" Column
            DataColumn dcMachine = new DataColumn();

            dcMachine.ColumnName = "Machine";
            dcMachine.DataType   = typeof(String);
            dt.Columns.Add(dcMachine);

            // Create the "Category" Column
            DataColumn dcCategory = new DataColumn();

            dcCategory.ColumnName = "Category";
            dcCategory.DataType   = typeof(String);
            dt.Columns.Add(dcCategory);

            // Create the "Label" Column
            DataColumn dcLabel = new DataColumn();

            dcLabel.ColumnName = "Label";
            dcLabel.DataType   = typeof(String);
            dt.Columns.Add(dcLabel);

            // Create the "Access" Column
            DataColumn dcAccess = new DataColumn();

            dcAccess.ColumnName = "Access";
            dcAccess.DataType   = typeof(String);
            dt.Columns.Add(dcAccess);



            // Now set up any column-specific behavioral stuff....
            // like not letting the checkboxes allow null, setting
            // column widths, etc.

            DataGridTableStyle          dgts          = new DataGridTableStyle();
            DataGridTextBoxColumn       dgtbcMachine  = new DataGridTextBoxColumn();
            DataGridTextBoxColumn       dgtbcCategory = new DataGridTextBoxColumn();
            DataGridTextBoxColumn       dgtbcLabel    = new DataGridTextBoxColumn();
            DataGridComboBoxColumnStyle dgccAccess    = new DataGridComboBoxColumnStyle();

            dg.TableStyles.Add(dgts);
            dgts.MappingName       = "Other";
            dgts.RowHeadersVisible = false;
            dgts.AllowSorting      = false;

            // Set up the column info for the Machine column
            dgtbcMachine.MappingName          = "Machine";
            dgtbcMachine.HeaderText           = CResourceStore.GetString("MessageQueuePermission:MachineName");
            dgtbcMachine.Width                = ScaleWidth(CResourceStore.GetInt("MessageQueuePermission:MachineColumnWidth"));
            dgtbcMachine.NullText             = "";
            dgtbcMachine.TextBox.TextChanged += new EventHandler(onChange);

            dgts.GridColumnStyles.Add(dgtbcMachine);

            // Set up the column info for the Category column
            dgtbcCategory.MappingName          = "Category";
            dgtbcCategory.HeaderText           = CResourceStore.GetString("MessageQueuePermission:Category");
            dgtbcCategory.Width                = ScaleWidth(CResourceStore.GetInt("MessageQueuePermission:CategoryColumnWidth"));
            dgtbcCategory.NullText             = "";
            dgtbcCategory.TextBox.TextChanged += new EventHandler(onChange);

            dgts.GridColumnStyles.Add(dgtbcCategory);

            // Set up the column info for the Label column
            dgtbcLabel.MappingName          = "Label";
            dgtbcLabel.HeaderText           = CResourceStore.GetString("MessageQueuePermission:Label");
            dgtbcLabel.Width                = ScaleWidth(CResourceStore.GetInt("MessageQueuePermission:LabelColumnWidth"));
            dgtbcLabel.NullText             = "";
            dgtbcLabel.TextBox.TextChanged += new EventHandler(onChange);

            dgts.GridColumnStyles.Add(dgtbcLabel);

            // Set up the column info for the Access column
            dgccAccess.MappingName = "Access";
            dgccAccess.HeaderText  = CResourceStore.GetString("MessageQueuePermission:Access");
            dgccAccess.Width       = ScaleWidth(CResourceStore.GetInt("MessageQueuePermission:AccessColumnWidth"));
            dgccAccess.DataSource  = new DataGridComboBoxEntry[] {
                new DataGridComboBoxEntry(CResourceStore.GetString("None")),
                new DataGridComboBoxEntry(CResourceStore.GetString("MessageQueuePermission:Browse")),
                new DataGridComboBoxEntry(CResourceStore.GetString("MessageQueuePermission:Peek")),
                new DataGridComboBoxEntry(CResourceStore.GetString("MessageQueuePermission:Send")),
                new DataGridComboBoxEntry(CResourceStore.GetString("MessageQueuePermission:Receive")),
                new DataGridComboBoxEntry(CResourceStore.GetString("MessageQueuePermission:Administer"))
            };
            dgccAccess.ComboBox.SelectedIndexChanged += new EventHandler(onChange);

            dgts.GridColumnStyles.Add(dgccAccess);

            return(dt);
        }// CreateOtherDataTable