Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / RoleGroupCollection.cs / 1305376 / RoleGroupCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System.Collections; using System.ComponentModel; 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)) ] 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.Principal; using System.Drawing.Design; using System.Web.Security; ////// Collection of RoleGroups. /// [ Editor("System.Web.UI.Design.WebControls.RoleGroupCollectionEditor, " + AssemblyRef.SystemDesign, typeof(UITypeEditor)) ] 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
- Encoder.cs
- TreeViewImageIndexConverter.cs
- UserControlAutomationPeer.cs
- WebPartCancelEventArgs.cs
- XomlSerializationHelpers.cs
- HtmlProps.cs
- ViewStateException.cs
- InitializingNewItemEventArgs.cs
- StateItem.cs
- TableColumn.cs
- XsltException.cs
- ColumnHeaderConverter.cs
- SessionPageStateSection.cs
- InstancePersistenceCommand.cs
- EmbeddedMailObjectsCollection.cs
- VirtualPath.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- WSSecurityXXX2005.cs
- UpdateCompiler.cs
- UserControl.cs
- AliasedSlot.cs
- EdmItemCollection.cs
- AssertFilter.cs
- ZoneIdentityPermission.cs
- ListViewInsertionMark.cs
- RenderingBiasValidation.cs
- SplineKeyFrames.cs
- PhoneCall.cs
- SafeHandle.cs
- ParserExtension.cs
- WebPartConnectionsCloseVerb.cs
- ErrorFormatterPage.cs
- FontInfo.cs
- PriorityBinding.cs
- ImageDrawing.cs
- Point3DValueSerializer.cs
- entityreference_tresulttype.cs
- sqlpipe.cs
- ArcSegment.cs
- FormViewRow.cs
- DesigntimeLicenseContext.cs
- DecimalAnimation.cs
- behaviorssection.cs
- Scene3D.cs
- XmlSchemaChoice.cs
- TextInfo.cs
- SoapFault.cs
- WinFormsComponentEditor.cs
- isolationinterop.cs
- DoubleAnimationUsingPath.cs
- XmlSerializationReader.cs
- Timeline.cs
- CriticalHandle.cs
- LocalizableResourceBuilder.cs
- SurrogateSelector.cs
- AnnotationAdorner.cs
- AppearanceEditorPart.cs
- CDSsyncETWBCLProvider.cs
- CodeTypeMember.cs
- TypeUnloadedException.cs
- EventBuilder.cs
- ProcessHostServerConfig.cs
- AccessibleObject.cs
- ApplicationManager.cs
- PerformanceCounterManager.cs
- ScriptResourceAttribute.cs
- Inflater.cs
- XpsSerializationManagerAsync.cs
- ResourceKey.cs
- TripleDES.cs
- LambdaValue.cs
- XPathSelectionIterator.cs
- DateTimeHelper.cs
- _AutoWebProxyScriptWrapper.cs
- TypeInformation.cs
- DocumentPageView.cs
- DynamicExpression.cs
- ReflectionHelper.cs
- ColumnBinding.cs
- _HeaderInfo.cs
- ValidatingReaderNodeData.cs
- WindowsScrollBarBits.cs
- PolyLineSegment.cs
- CornerRadiusConverter.cs
- WindowsScroll.cs
- DataSourceControlBuilder.cs
- DeferredBinaryDeserializerExtension.cs
- WindowsGraphics2.cs
- EdmEntityTypeAttribute.cs
- DataControlFieldCell.cs
- COM2ColorConverter.cs
- SortKey.cs
- Speller.cs
- basevalidator.cs
- ClientSettingsProvider.cs
- LinkButton.cs
- HtmlPhoneCallAdapter.cs
- WSSecureConversation.cs
- AuthorizationRule.cs
- HotSpotCollection.cs