Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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. // //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OrderPreservingPipeliningSpoolingTask.cs
- PerspectiveCamera.cs
- QuaternionAnimation.cs
- ProfileBuildProvider.cs
- ButtonColumn.cs
- BitConverter.cs
- ValidationErrorEventArgs.cs
- BezierSegment.cs
- bindurihelper.cs
- MailHeaderInfo.cs
- UInt16Converter.cs
- ExpressionEvaluator.cs
- JobCollate.cs
- AuthenticationModuleElement.cs
- UnauthorizedWebPart.cs
- ObjectDataProvider.cs
- XmlSerializerOperationFormatter.cs
- FullTrustAssembly.cs
- SpellerHighlightLayer.cs
- XmlSchemaException.cs
- SafeSerializationManager.cs
- ByteStreamGeometryContext.cs
- SerializationSectionGroup.cs
- BitArray.cs
- CapiHashAlgorithm.cs
- MatrixConverter.cs
- CompModSwitches.cs
- EntityConnection.cs
- HtmlEncodedRawTextWriter.cs
- UIInitializationException.cs
- CommonDialog.cs
- IProvider.cs
- WizardForm.cs
- NumberFormatInfo.cs
- BoolLiteral.cs
- ErasingStroke.cs
- SystemWebSectionGroup.cs
- ControlPaint.cs
- SessionStateContainer.cs
- CalendarModeChangedEventArgs.cs
- GlobalItem.cs
- UIElementIsland.cs
- MemberAccessException.cs
- sqlser.cs
- RefreshEventArgs.cs
- TextParentUndoUnit.cs
- Visitors.cs
- ReflectionHelper.cs
- WindowsTooltip.cs
- AnimationLayer.cs
- MaterializeFromAtom.cs
- ControlDesignerState.cs
- FamilyMapCollection.cs
- XmlSortKey.cs
- SystemThemeKey.cs
- DotExpr.cs
- CommonProperties.cs
- SiteMapDataSourceDesigner.cs
- NamedPermissionSet.cs
- CqlIdentifiers.cs
- XamlTypeMapper.cs
- WebAdminConfigurationHelper.cs
- RequestBringIntoViewEventArgs.cs
- ConnectionInterfaceCollection.cs
- ImageBrush.cs
- UrlParameterReader.cs
- FormViewInsertEventArgs.cs
- StringInfo.cs
- XmlSerializerSection.cs
- SamlAuthorizationDecisionClaimResource.cs
- Expressions.cs
- ArrangedElement.cs
- LoginName.cs
- GetCryptoTransformRequest.cs
- InvalidContentTypeException.cs
- PropertyBuilder.cs
- SubpageParagraph.cs
- ObjectConverter.cs
- ApplyImportsAction.cs
- SystemPens.cs
- LocalizedNameDescriptionPair.cs
- XmlSchemaComplexContentExtension.cs
- AmbientProperties.cs
- XPathDocumentNavigator.cs
- OleDbTransaction.cs
- MaskInputRejectedEventArgs.cs
- GlobalProxySelection.cs
- EventMemberCodeDomSerializer.cs
- XmlSchemaObjectCollection.cs
- LineBreakRecord.cs
- SortDescriptionCollection.cs
- SkewTransform.cs
- Effect.cs
- SymbolType.cs
- StringToken.cs
- ResourcesGenerator.cs
- SqlExpressionNullability.cs
- Int32AnimationBase.cs
- OrthographicCamera.cs
- DataBindingList.cs