Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebControls / RoleGroupCollection.cs / 1 / RoleGroupCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System.Collections; using System.ComponentModel; using System.Security.Permissions; using System.Security.Principal; using System.Drawing.Design; using System.Web.Security; ////// Collection of RoleGroups. /// [ Editor("System.Web.UI.Design.WebControls.RoleGroupCollectionEditor, " + AssemblyRef.SystemDesign, typeof(UITypeEditor)) ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class RoleGroupCollection : CollectionBase { public RoleGroup this[int index] { get { return (RoleGroup)List[index]; } } public void Add(RoleGroup group) { List.Add(group); } public void CopyTo(RoleGroup[] array, int index) { List.CopyTo(array, index); } public bool Contains(RoleGroup group) { return List.Contains(group); } ////// The first RoleGroup that contains the user. /// public RoleGroup GetMatchingRoleGroup(IPrincipal user) { int index = GetMatchingRoleGroupInternal(user); if (index != -1) { return this[index]; } return null; } ////// Index of the first RoleGroup that contains the user. Internal because called from LoginView. /// internal int GetMatchingRoleGroupInternal(IPrincipal user) { if (user == null) { throw new ArgumentNullException("user"); } int i = 0; foreach (RoleGroup group in this) { if (group.ContainsUser(user)) { return i; } i++; } return -1; } public int IndexOf(RoleGroup group) { return List.IndexOf(group); } public void Insert(int index, RoleGroup group) { List.Insert(index, group); } protected override void OnValidate(object value) { base.OnValidate(value); if (!(value is RoleGroup)) { throw new ArgumentException(SR.GetString(SR.RoleGroupCollection_InvalidType), "value"); } } public void Remove(RoleGroup group) { int index = IndexOf(group); if (index >= 0) { List.RemoveAt(index); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ClientScriptManager.cs
- AccessibleObject.cs
- AnnotationComponentChooser.cs
- metadatamappinghashervisitor.cs
- DataObjectEventArgs.cs
- OracleParameter.cs
- ProcessHostMapPath.cs
- SystemMulticastIPAddressInformation.cs
- CdpEqualityComparer.cs
- UnsafeNativeMethods.cs
- XmlIncludeAttribute.cs
- UidManager.cs
- AbandonedMutexException.cs
- Classification.cs
- HttpRuntimeSection.cs
- ListViewInsertedEventArgs.cs
- EnvironmentPermission.cs
- XmlNodeChangedEventArgs.cs
- MetadataElement.cs
- FixedSOMFixedBlock.cs
- TreeNodeStyle.cs
- TableColumn.cs
- PeerResolver.cs
- QueryContinueDragEventArgs.cs
- SqlCharStream.cs
- MediaElementAutomationPeer.cs
- FrameAutomationPeer.cs
- SoapInteropTypes.cs
- TypeUsageBuilder.cs
- MemberDomainMap.cs
- StatusBarDrawItemEvent.cs
- ParagraphResult.cs
- EastAsianLunisolarCalendar.cs
- ExclusiveHandleList.cs
- FrameworkContentElement.cs
- Mapping.cs
- FileInfo.cs
- KeyNotFoundException.cs
- AddingNewEventArgs.cs
- DesigntimeLicenseContext.cs
- WebControlAdapter.cs
- ShaperBuffers.cs
- InteropBitmapSource.cs
- ContractBase.cs
- MimeTypePropertyAttribute.cs
- PreviewPrintController.cs
- CoTaskMemUnicodeSafeHandle.cs
- TabControlToolboxItem.cs
- HostingEnvironmentWrapper.cs
- SqlFormatter.cs
- IChannel.cs
- TypeDependencyAttribute.cs
- MD5HashHelper.cs
- NamedServiceModelExtensionCollectionElement.cs
- WebServiceMethodData.cs
- FontFamilyConverter.cs
- ObjectItemCollection.cs
- EntityDataSourceReferenceGroup.cs
- EmptyEnumerable.cs
- Errors.cs
- PerformanceCounter.cs
- ToolStripContextMenu.cs
- DefaultValueTypeConverter.cs
- DataGridViewCell.cs
- NodeCounter.cs
- ProviderUtil.cs
- TdsParserSafeHandles.cs
- GridPattern.cs
- NavigationHelper.cs
- TypeElement.cs
- TemplatedWizardStep.cs
- figurelengthconverter.cs
- DesignerRegionMouseEventArgs.cs
- IdentityReference.cs
- handlecollector.cs
- LoginName.cs
- RequestReplyCorrelator.cs
- OleDbRowUpdatingEvent.cs
- ArgumentNullException.cs
- HostedController.cs
- XAMLParseException.cs
- ToolStripItemImageRenderEventArgs.cs
- GradientSpreadMethodValidation.cs
- Script.cs
- IntSecurity.cs
- WindowsGraphics2.cs
- DesignOnlyAttribute.cs
- fixedPageContentExtractor.cs
- SatelliteContractVersionAttribute.cs
- MultipartIdentifier.cs
- TextReader.cs
- DbDeleteCommandTree.cs
- SecurityValidationBehavior.cs
- TextHidden.cs
- TablePattern.cs
- HttpApplicationFactory.cs
- InvokePattern.cs
- PointAnimationUsingKeyFrames.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- InternalDuplexChannelFactory.cs