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
- ClientApiGenerator.cs
- SqlUserDefinedAggregateAttribute.cs
- PauseStoryboard.cs
- SQLInt16Storage.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- SpotLight.cs
- InternalResources.cs
- RijndaelManagedTransform.cs
- PropertyTab.cs
- TextDecorationCollection.cs
- ManagedWndProcTracker.cs
- EntityDataSource.cs
- KeysConverter.cs
- TableParagraph.cs
- AuthorizationRule.cs
- ResourceKey.cs
- FlowLayoutSettings.cs
- OutputCacheSettingsSection.cs
- AssemblyFilter.cs
- SqlDataSourceQueryEditorForm.cs
- TableHeaderCell.cs
- VideoDrawing.cs
- PasswordRecovery.cs
- BamlLocalizableResource.cs
- StylusButtonCollection.cs
- Positioning.cs
- DBCommandBuilder.cs
- HtmlGenericControl.cs
- DriveInfo.cs
- QueryExpr.cs
- SqlLiftWhereClauses.cs
- SimpleRecyclingCache.cs
- SoapUnknownHeader.cs
- AppDomainFactory.cs
- CodeAttachEventStatement.cs
- Int16AnimationBase.cs
- TextBox.cs
- ProxyWebPart.cs
- StateRuntime.cs
- ProcessMonitor.cs
- XamlReader.cs
- WebPartDisplayModeCollection.cs
- ContainsSearchOperator.cs
- DocumentPageHost.cs
- MailBnfHelper.cs
- RuntimeConfigLKG.cs
- Point.cs
- ContextMarshalException.cs
- EventData.cs
- ActiveXSerializer.cs
- RuleConditionDialog.Designer.cs
- TemplateBindingExpression.cs
- ComponentDispatcherThread.cs
- SqlNotificationRequest.cs
- FormViewRow.cs
- DataBoundControlAdapter.cs
- Listbox.cs
- EmptyStringExpandableObjectConverter.cs
- StringUtil.cs
- UniqueConstraint.cs
- BasicViewGenerator.cs
- XamlClipboardData.cs
- AvTrace.cs
- BigInt.cs
- DelegatingConfigHost.cs
- PropVariant.cs
- PrintEvent.cs
- SettingsPropertyWrongTypeException.cs
- Console.cs
- KeysConverter.cs
- RoutedEventHandlerInfo.cs
- UpdateTranslator.cs
- LingerOption.cs
- GeneralTransformCollection.cs
- HtmlLiteralTextAdapter.cs
- ThreadAbortException.cs
- CodeNamespaceImport.cs
- GridToolTip.cs
- PingOptions.cs
- InternalSafeNativeMethods.cs
- COM2IDispatchConverter.cs
- InstanceDataCollection.cs
- ModuleBuilder.cs
- XmlDataCollection.cs
- ExtentKey.cs
- EarlyBoundInfo.cs
- IriParsingElement.cs
- RequestValidator.cs
- PrimitiveType.cs
- ForeignConstraint.cs
- NamedPermissionSet.cs
- DynamicRouteExpression.cs
- AutoGeneratedField.cs
- WebBaseEventKeyComparer.cs
- TextFragmentEngine.cs
- BamlRecordWriter.cs
- TypeConverterHelper.cs
- ConfigurationSettings.cs
- ParameterInfo.cs
- Material.cs