Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- BooleanToVisibilityConverter.cs
- XmlWrappingReader.cs
- Command.cs
- StringPropertyBuilder.cs
- WindowsEditBox.cs
- DoubleCollection.cs
- WebPartEditorCancelVerb.cs
- GlyphRunDrawing.cs
- ContextItemManager.cs
- OpenTypeLayout.cs
- PropertyRecord.cs
- DBSqlParserColumnCollection.cs
- GZipObjectSerializer.cs
- SQLInt64.cs
- PagesSection.cs
- DocumentXPathNavigator.cs
- CodeSpit.cs
- XPathArrayIterator.cs
- RenderData.cs
- SingleBodyParameterMessageFormatter.cs
- MatrixAnimationUsingPath.cs
- UserNamePasswordValidator.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- __ComObject.cs
- ConnectionsZoneAutoFormat.cs
- ModelChangedEventArgsImpl.cs
- XamlParser.cs
- ExpressionBuilder.cs
- TreeView.cs
- IPipelineRuntime.cs
- WebRequestModuleElementCollection.cs
- SafeSecurityHelper.cs
- ControlParameter.cs
- WebControl.cs
- CaseCqlBlock.cs
- NamespaceList.cs
- SQLCharsStorage.cs
- OdbcPermission.cs
- WindowsAuthenticationEventArgs.cs
- WeakReadOnlyCollection.cs
- diagnosticsswitches.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- ISFClipboardData.cs
- WindowsTreeView.cs
- ValidationError.cs
- SplitContainer.cs
- recordstatefactory.cs
- ParallelTimeline.cs
- Win32Exception.cs
- XmlDictionaryWriter.cs
- PrimitiveRenderer.cs
- RijndaelManaged.cs
- RelationshipType.cs
- XomlCompilerHelpers.cs
- PolicyUnit.cs
- TraceContextEventArgs.cs
- SeekStoryboard.cs
- TextServicesPropertyRanges.cs
- ControlPropertyNameConverter.cs
- SymbolEqualComparer.cs
- KeyFrames.cs
- TableSectionStyle.cs
- AutomationPropertyInfo.cs
- DataPagerFieldItem.cs
- EncodingFallbackAwareXmlTextWriter.cs
- ACL.cs
- WebPartManagerInternals.cs
- CharEnumerator.cs
- HttpRuntimeSection.cs
- SchemaTypeEmitter.cs
- FixedStringLookup.cs
- XmlBaseWriter.cs
- HttpFileCollection.cs
- RealProxy.cs
- Baml6ConstructorInfo.cs
- FieldInfo.cs
- XsdDuration.cs
- DefaultPrintController.cs
- WebPartEventArgs.cs
- StoreContentChangedEventArgs.cs
- WindowsPen.cs
- PartitionedStream.cs
- Light.cs
- UnsafeNativeMethods.cs
- RootBuilder.cs
- CollectionViewGroupRoot.cs
- SineEase.cs
- _LocalDataStoreMgr.cs
- DesignConnectionCollection.cs
- SourceChangedEventArgs.cs
- WebServicesSection.cs
- BitmapEffectGroup.cs
- Stack.cs
- XmlSerializerNamespaces.cs
- ApplicationFileParser.cs
- InternalResources.cs
- TextRangeEditTables.cs
- XmlAnyElementAttributes.cs
- CatalogPartCollection.cs
- GeneralTransform2DTo3D.cs