Code:
/ FX-1434 / FX-1434 / 1.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
- ArrowControl.xaml.cs
- HWStack.cs
- ToolboxItemCollection.cs
- ProvideValueServiceProvider.cs
- DesignerWidgets.cs
- MetadataSource.cs
- SelectorItemAutomationPeer.cs
- TableItemProviderWrapper.cs
- AsyncOperation.cs
- PropertyEntry.cs
- MasterPageBuildProvider.cs
- HttpWebRequestElement.cs
- CommandManager.cs
- IPipelineRuntime.cs
- regiisutil.cs
- SymDocumentType.cs
- _ListenerAsyncResult.cs
- UserControlAutomationPeer.cs
- HtmlUtf8RawTextWriter.cs
- FormatterConverter.cs
- FormatSettings.cs
- ApplicationGesture.cs
- MailWebEventProvider.cs
- DataGridLinkButton.cs
- CopyCodeAction.cs
- ForwardPositionQuery.cs
- TypeSource.cs
- CommandHelper.cs
- SelectedGridItemChangedEvent.cs
- SafeCertificateStore.cs
- JoinCqlBlock.cs
- LinqDataSourceInsertEventArgs.cs
- CultureTableRecord.cs
- HttpException.cs
- XmlFormatExtensionPointAttribute.cs
- BitmapFrameDecode.cs
- baseshape.cs
- UnsupportedPolicyOptionsException.cs
- AdCreatedEventArgs.cs
- Privilege.cs
- DocumentOrderQuery.cs
- CellTreeNodeVisitors.cs
- ReflectEventDescriptor.cs
- ComponentGuaranteesAttribute.cs
- DrawingGroup.cs
- PrePrepareMethodAttribute.cs
- SamlAuthenticationClaimResource.cs
- SettingsContext.cs
- Part.cs
- ArrayElementGridEntry.cs
- PropertyEmitter.cs
- SmtpSection.cs
- EntityTypeEmitter.cs
- LoadRetryConstantStrategy.cs
- GridViewDeletedEventArgs.cs
- DllNotFoundException.cs
- SendMailErrorEventArgs.cs
- TraceHandlerErrorFormatter.cs
- Region.cs
- WebPartEditorApplyVerb.cs
- IMembershipProvider.cs
- WinCategoryAttribute.cs
- ParserOptions.cs
- PtsContext.cs
- DictionaryEntry.cs
- Label.cs
- CommandBinding.cs
- LinqDataSourceContextEventArgs.cs
- TimelineClockCollection.cs
- SourceInterpreter.cs
- ModelPropertyDescriptor.cs
- BackgroundWorker.cs
- BamlWriter.cs
- CornerRadiusConverter.cs
- DataGridViewSelectedCellCollection.cs
- PingReply.cs
- Panel.cs
- SQLDateTime.cs
- GradientStop.cs
- SelectorAutomationPeer.cs
- ApplicationServiceManager.cs
- Random.cs
- ExtensionWindow.cs
- FunctionNode.cs
- IIS7UserPrincipal.cs
- SafeRegistryHandle.cs
- DesigntimeLicenseContext.cs
- ImageListStreamer.cs
- XmlObjectSerializerReadContextComplex.cs
- ResourceExpressionBuilder.cs
- Point3DKeyFrameCollection.cs
- ModelPropertyDescriptor.cs
- UpdateTranslator.cs
- HMACRIPEMD160.cs
- SharedDp.cs
- PersonalizationProviderCollection.cs
- BamlResourceSerializer.cs
- TraceFilter.cs
- SpeakInfo.cs
- XhtmlConformanceSection.cs