}// CreateDataTable protected override void PutValuesinPage() { // Put in the text for the radio buttons m_radUnrestricted.Text = CResourceStore.GetString("PerformanceCounterPerm:GrantUnrestrict"); m_radGrantFollowingPermission.Text = CResourceStore.GetString("PerformanceCounterPerm:GrantFollowing"); PerformanceCounterPermission perm = (PerformanceCounterPermission)m_perm; CheckUnrestricted(perm); if (!perm.IsUnrestricted()) { // Run through the list of socket permissions we have to accept connections IEnumerator enumer = perm.PermissionEntries.GetEnumerator(); while (enumer.MoveNext()) { PerformanceCounterPermissionEntry pcpe = (PerformanceCounterPermissionEntry)enumer.Current; DataRow newRow; newRow = m_dt.NewRow(); newRow["Machine"] = pcpe.MachineName; newRow["Category"] = pcpe.CategoryName; // Determine the Access String String sAccess = null; if ((pcpe.PermissionAccess & PerformanceCounterPermissionAccess.Administer) == PerformanceCounterPermissionAccess.Administer) { sAccess = CResourceStore.GetString("PerformanceCounterPermission:Administer"); } else if ((pcpe.PermissionAccess & PerformanceCounterPermissionAccess.Instrument) == PerformanceCounterPermissionAccess.Instrument) { sAccess = CResourceStore.GetString("PerformanceCounterPermission:Instrument"); } else if ((pcpe.PermissionAccess & PerformanceCounterPermissionAccess.Browse) == PerformanceCounterPermissionAccess.Browse) { sAccess = CResourceStore.GetString("PerformanceCounterPermission:Browse"); } else { sAccess = CResourceStore.GetString("None"); } newRow["Access"] = new DataGridComboBoxEntry(sAccess); m_dt.Rows.Add(newRow); } } // We want at least 1 row so it looks pretty while (m_dt.Rows.Count < 1) { AddEmptyRow(m_dt); } }// PutValuesinPage
}// CreateDataTable protected override void PutValuesinPage() { // Put in the text for the radio buttons m_radUnrestricted.Text = CResourceStore.GetString("EventLogPermission:GrantUnrestrict"); m_radGrantFollowingPermission.Text = CResourceStore.GetString("EventLogPermission:GrantFollowing"); EventLogPermission perm = (EventLogPermission)m_perm; CheckUnrestricted(perm); if (!perm.IsUnrestricted()) { // Run through the list of socket permissions we have to accept connections IEnumerator enumer = perm.PermissionEntries.GetEnumerator(); while (enumer.MoveNext()) { EventLogPermissionEntry elpp = (EventLogPermissionEntry)enumer.Current; DataRow newRow; newRow = m_dt.NewRow(); newRow["Machine"] = elpp.MachineName; String sAccess = CResourceStore.GetString("None"); if ((elpp.PermissionAccess & EventLogPermissionAccess.Audit) == EventLogPermissionAccess.Audit) { sAccess = CResourceStore.GetString("EventLogPermission:Audit"); } else if ((elpp.PermissionAccess & EventLogPermissionAccess.Instrument) == EventLogPermissionAccess.Instrument) { sAccess = CResourceStore.GetString("EventLogPermission:Instrument"); } else if ((elpp.PermissionAccess & EventLogPermissionAccess.Browse) == EventLogPermissionAccess.Browse) { sAccess = CResourceStore.GetString("EventLogPermission:Browse"); } newRow["Access"] = new DataGridComboBoxEntry(sAccess); m_dt.Rows.Add(newRow); } } // We want at least 1 row so it looks pretty while (m_dt.Rows.Count < 1) { AddEmptyRow(m_dt); } }// PutValuesinPage
}// CreateDataTable protected override void PutValuesinPage() { // Put in the text for the radio buttons m_radUnrestricted.Text = CResourceStore.GetString("SocketPerm:GrantUnrestrict"); m_radGrantFollowingPermission.Text = CResourceStore.GetString("SocketPerm:GrantFollowing"); SocketPermission perm = (SocketPermission)m_perm; CheckUnrestricted(perm); if (!perm.IsUnrestricted()) { // Run through the list of socket permissions we have to accept connections IEnumerator enumer = perm.AcceptList; while (enumer.MoveNext()) { EndpointPermission epp = (EndpointPermission)enumer.Current; DataRow newRow; newRow = m_dt.NewRow(); newRow["Host"] = epp.Hostname; newRow["Port"] = epp.Port.ToString(); newRow["Direction"] = new DataGridComboBoxEntry(CResourceStore.GetString("SocketPermission:Accept")); newRow["TCP"] = ((epp.Transport & TransportType.Tcp) == TransportType.Tcp); newRow["UDP"] = ((epp.Transport & TransportType.Udp) == TransportType.Udp); m_dt.Rows.Add(newRow); } // Run through the list of socket permissions we have to connect through enumer = perm.ConnectList; while (enumer.MoveNext()) { EndpointPermission epp = (EndpointPermission)enumer.Current; DataRow newRow; newRow = m_dt.NewRow(); newRow["Host"] = epp.Hostname; newRow["Port"] = epp.Port.ToString(); newRow["Direction"] = CResourceStore.GetString("SocketPermission:Connect"); newRow["TCP"] = ((epp.Transport & TransportType.Tcp) == TransportType.Tcp); newRow["UDP"] = ((epp.Transport & TransportType.Udp) == TransportType.Udp); m_dt.Rows.Add(newRow); } } // We want at least 1 row so it looks pretty while (m_dt.Rows.Count < 1) { AddEmptyRow(m_dt); } }// PutValuesinPage
}// CreateDataTable protected override void PutValuesinPage() { // Put in the text for the radio buttons m_radUnrestricted.Text = CResourceStore.GetString("ServiceControllerPerm:GrantUnrestrict"); m_radGrantFollowingPermission.Text = CResourceStore.GetString("ServiceControllerPerm:GrantFollowing"); ServiceControllerPermission perm = (ServiceControllerPermission)m_perm; CheckUnrestricted(perm); if (!perm.IsUnrestricted()) { IEnumerator enumer = perm.PermissionEntries.GetEnumerator(); while (enumer.MoveNext()) { ServiceControllerPermissionEntry scpe = (ServiceControllerPermissionEntry)enumer.Current; DataRow newRow; newRow = m_dt.NewRow(); newRow["Machine"] = scpe.MachineName; newRow["Service"] = scpe.ServiceName; // Determine the Access String String sAccess; if ((scpe.PermissionAccess & ServiceControllerPermissionAccess.Control) == ServiceControllerPermissionAccess.Control) { sAccess = CResourceStore.GetString("ServiceControllerPermission:Control"); } else if ((scpe.PermissionAccess & ServiceControllerPermissionAccess.Browse) == ServiceControllerPermissionAccess.Browse) { sAccess = CResourceStore.GetString("ServiceControllerPermission:Browse"); } else { sAccess = CResourceStore.GetString("None"); } newRow["Access"] = new DataGridComboBoxEntry(sAccess); m_dt.Rows.Add(newRow); } } // We want at least 1 row so it looks pretty while (m_dt.Rows.Count < 1) { AddEmptyRow(m_dt); } }// PutValuesinPage
}// CreateDataTable protected override void PutValuesinPage() { // Put in the text for the radio buttons m_radUnrestricted.Text = CResourceStore.GetString("DirectoryServicesPerm:GrantUnrestrict"); m_radGrantFollowingPermission.Text = CResourceStore.GetString("DirectoryServicesPerm:GrantFollowing"); DirectoryServicesPermission perm = (DirectoryServicesPermission)m_perm; CheckUnrestricted(perm); if (!perm.IsUnrestricted()) { // Run through the list of socket permissions we have to accept connections IEnumerator enumer = perm.PermissionEntries.GetEnumerator(); while (enumer.MoveNext()) { DirectoryServicesPermissionEntry dspp = (DirectoryServicesPermissionEntry)enumer.Current; DataRow newRow; newRow = m_dt.NewRow(); newRow["Path"] = dspp.Path; String sAccessString = ""; if (dspp.PermissionAccess == DirectoryServicesPermissionAccess.Browse) { sAccessString = CResourceStore.GetString("DirectoryServicesPermission:Browse"); } else if (dspp.PermissionAccess == DirectoryServicesPermissionAccess.Write) { sAccessString = CResourceStore.GetString("DirectoryServicesPermission:Write"); } else { sAccessString = CResourceStore.GetString("<unknown>"); } newRow["Access"] = new DataGridComboBoxEntry(sAccessString); m_dt.Rows.Add(newRow); } } // We want at least 1 row so it looks pretty while (m_dt.Rows.Count < 1) { AddEmptyRow(m_dt); } }// PutValuesinPage
}// CreateOtherDataTable //------------------------------------------------- // PutValuesinPage // // Initializes the controls with the provided permission //------------------------------------------------- protected override void PutValuesinPage() { // Put in the text for the radio buttons m_radUnrestricted.Text = CResourceStore.GetString("MessageQueuePermission:GrantUnrestrict"); m_radGrantFollowingPermission.Text = CResourceStore.GetString("MessageQueuePermission:GrantFollowing"); MessageQueuePermission perm = (MessageQueuePermission)m_perm; CheckUnrestricted(perm); if (!perm.IsUnrestricted()) { // Run through the list of socket permissions we have to accept connections IEnumerator enumer = perm.PermissionEntries.GetEnumerator(); while (enumer.MoveNext()) { MessageQueuePermissionEntry mqpp = (MessageQueuePermissionEntry)enumer.Current; String sAccess = CResourceStore.GetString("None"); if ((mqpp.PermissionAccess & MessageQueuePermissionAccess.Administer) == MessageQueuePermissionAccess.Administer) { sAccess = CResourceStore.GetString("MessageQueuePermission:Administer"); } else if ((mqpp.PermissionAccess & MessageQueuePermissionAccess.Receive) == MessageQueuePermissionAccess.Receive) { sAccess = CResourceStore.GetString("MessageQueuePermission:Receive"); } else if ((mqpp.PermissionAccess & MessageQueuePermissionAccess.Peek) == MessageQueuePermissionAccess.Peek) { sAccess = CResourceStore.GetString("MessageQueuePermission:Peek"); } else if ((mqpp.PermissionAccess & MessageQueuePermissionAccess.Send) == MessageQueuePermissionAccess.Send) { sAccess = CResourceStore.GetString("MessageQueuePermission:Send"); } else if ((mqpp.PermissionAccess & MessageQueuePermissionAccess.Browse) == MessageQueuePermissionAccess.Browse) { sAccess = CResourceStore.GetString("MessageQueuePermission:Browse"); } DataRow newRow; // Figure out what type of row we're adding if (mqpp.Path != null && mqpp.Path.Length > 0) { newRow = m_dtPath.NewRow(); newRow["Path"] = mqpp.Path; newRow["Access"] = new DataGridComboBoxEntry(sAccess); m_dtPath.Rows.Add(newRow); } else { newRow = m_dtOther.NewRow(); newRow["Machine"] = mqpp.MachineName; newRow["Category"] = (mqpp.Category != null)?mqpp.Category:""; newRow["Label"] = (mqpp.Label != null)?mqpp.Label:""; newRow["Access"] = new DataGridComboBoxEntry(sAccess); m_dtOther.Rows.Add(newRow); } } } // We want at least 1 rows so it looks pretty while (m_dtPath.Rows.Count < 1) { AddEmptyPathRow(m_dtPath); } // We want at least 1 rows so it looks pretty while (m_dtOther.Rows.Count < 1) { AddEmptyOtherRow(m_dtOther); } }// PutValuesinPage