Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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); } } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlConnectionPoolProviderInfo.cs
- SafeLibraryHandle.cs
- MappingSource.cs
- RuleSettingsCollection.cs
- XamlDesignerSerializationManager.cs
- SmtpClient.cs
- WpfKnownMember.cs
- CodeSnippetTypeMember.cs
- AsnEncodedData.cs
- EntityTransaction.cs
- MouseActionValueSerializer.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- ProviderConnectionPoint.cs
- SineEase.cs
- PreProcessInputEventArgs.cs
- SafeNativeMethodsCLR.cs
- FixedSOMPage.cs
- SimpleMailWebEventProvider.cs
- ProxyGenerator.cs
- AutomationElementIdentifiers.cs
- PersonalizationProvider.cs
- TripleDESCryptoServiceProvider.cs
- UiaCoreProviderApi.cs
- ListBase.cs
- Directory.cs
- TiffBitmapDecoder.cs
- BoundsDrawingContextWalker.cs
- FormsAuthenticationConfiguration.cs
- QilList.cs
- ServiceModelPerformanceCounters.cs
- ResXDataNode.cs
- PropertyItemInternal.cs
- LocalizationParserHooks.cs
- XmlWhitespace.cs
- GridViewRowPresenterBase.cs
- BinaryObjectWriter.cs
- TypeSystemHelpers.cs
- DeliveryStrategy.cs
- DeleteCardRequest.cs
- TraceHelpers.cs
- DataGridCaption.cs
- CustomPopupPlacement.cs
- ListViewCommandEventArgs.cs
- ErrorTableItemStyle.cs
- ToolStripStatusLabel.cs
- Geometry.cs
- ContentElement.cs
- ConfigurationProperty.cs
- BufferedStream.cs
- Utils.cs
- IODescriptionAttribute.cs
- GetIsBrowserClientRequest.cs
- ClusterSafeNativeMethods.cs
- ToolStripPanelRow.cs
- ChangeDirector.cs
- RowUpdatedEventArgs.cs
- TransmissionStrategy.cs
- UnsafeNativeMethodsMilCoreApi.cs
- AuthorizationPolicyTypeElementCollection.cs
- UpdatePanelTriggerCollection.cs
- NumberFormatInfo.cs
- BatchStream.cs
- InkCanvasInnerCanvas.cs
- ViewLoader.cs
- HtmlTableRow.cs
- StandardCommands.cs
- InternalsVisibleToAttribute.cs
- DerivedKeyCachingSecurityTokenSerializer.cs
- PropertyGrid.cs
- ZoomComboBox.cs
- FileChangesMonitor.cs
- TextLine.cs
- SRef.cs
- CorruptingExceptionCommon.cs
- FilteredDataSetHelper.cs
- SkinIDTypeConverter.cs
- NativeWindow.cs
- DebugHandleTracker.cs
- CollectionViewGroupInternal.cs
- ExternalException.cs
- ApplicationInfo.cs
- InheritanceAttribute.cs
- SortDescriptionCollection.cs
- VBIdentifierNameEditor.cs
- DataGridViewAdvancedBorderStyle.cs
- GlobalProxySelection.cs
- FrameworkElementAutomationPeer.cs
- DialogResultConverter.cs
- ServiceCredentialsSecurityTokenManager.cs
- CookielessData.cs
- controlskin.cs
- StringComparer.cs
- ImageMap.cs
- GeometryModel3D.cs
- HttpSessionStateWrapper.cs
- AnnotationObservableCollection.cs
- InfoCardListRequest.cs
- PingOptions.cs
- ValidationPropertyAttribute.cs
- PersianCalendar.cs