Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- SqlInternalConnectionSmi.cs
- Win32MouseDevice.cs
- DataGridPageChangedEventArgs.cs
- IChannel.cs
- GeometryHitTestResult.cs
- AdobeCFFWrapper.cs
- TemplateBindingExtension.cs
- FormViewPageEventArgs.cs
- Simplifier.cs
- SubpageParaClient.cs
- CachedFontFace.cs
- CodeGen.cs
- ClaimTypes.cs
- GZipObjectSerializer.cs
- UdpSocketReceiveManager.cs
- Size.cs
- TextEditor.cs
- LogEntryUtils.cs
- NameObjectCollectionBase.cs
- CryptoConfig.cs
- ManifestResourceInfo.cs
- SiteMapHierarchicalDataSourceView.cs
- BitmapDecoder.cs
- ErrorRuntimeConfig.cs
- DomainLiteralReader.cs
- CodeMethodInvokeExpression.cs
- TokenBasedSet.cs
- ProcessHostServerConfig.cs
- DefaultValueTypeConverter.cs
- BaseCollection.cs
- DeviceContext.cs
- ToolStripDropDownClosedEventArgs.cs
- _StreamFramer.cs
- XmlCustomFormatter.cs
- PropertySegmentSerializer.cs
- TextServicesDisplayAttributePropertyRanges.cs
- UserControlParser.cs
- QuadraticBezierSegment.cs
- RightsDocument.cs
- IsolationInterop.cs
- PropertyKey.cs
- HttpModuleActionCollection.cs
- _NegoStream.cs
- GenericRootAutomationPeer.cs
- CatalogPartCollection.cs
- EventData.cs
- IncrementalCompileAnalyzer.cs
- MetadataArtifactLoaderCompositeFile.cs
- CheckedListBox.cs
- FontConverter.cs
- VirtualDirectoryMappingCollection.cs
- SoapSchemaExporter.cs
- WebHeaderCollection.cs
- DocumentAutomationPeer.cs
- PlacementWorkspace.cs
- AttachedPropertyDescriptor.cs
- InitializerFacet.cs
- TableAutomationPeer.cs
- BindingEntityInfo.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- RemoteWebConfigurationHostServer.cs
- EnumUnknown.cs
- SafeFileMappingHandle.cs
- HtmlSelect.cs
- EntityContainer.cs
- ZipIOCentralDirectoryFileHeader.cs
- DateTimeParse.cs
- DataControlPagerLinkButton.cs
- WebPartTracker.cs
- MexHttpBindingElement.cs
- ComplexBindingPropertiesAttribute.cs
- Main.cs
- ParallelTimeline.cs
- FileVersionInfo.cs
- QueryCursorEventArgs.cs
- ApplyTemplatesAction.cs
- EventHandlerList.cs
- SerializationException.cs
- SwitchExpression.cs
- BitmapInitialize.cs
- NTAccount.cs
- CodeValidator.cs
- WorkerProcess.cs
- Comparer.cs
- HttpDictionary.cs
- EmptyReadOnlyDictionaryInternal.cs
- FileSystemEventArgs.cs
- DateTimeOffsetAdapter.cs
- Comparer.cs
- PersistChildrenAttribute.cs
- WindowsIPAddress.cs
- ColorConverter.cs
- TextServicesProperty.cs
- EmptyEnumerator.cs
- File.cs
- FixedPage.cs
- ContainerParagraph.cs
- IntPtr.cs
- ServiceModelExtensionElement.cs
- XhtmlBasicListAdapter.cs