Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / Security / Principal / GenericPrincipal.cs / 2 / GenericPrincipal.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // GenericPrincipal.cs // namespace System.Security.Principal { using System.Runtime.Remoting; using System; using System.Security.Util; using System.Globalization; [Serializable] [System.Runtime.InteropServices.ComVisible(true)] public class GenericPrincipal : IPrincipal { private IIdentity m_identity; private string[] m_roles; public GenericPrincipal (IIdentity identity, string[] roles) { if (identity == null) throw new ArgumentNullException("identity"); m_identity = identity; if (roles != null) { m_roles = new string[roles.Length]; for (int i = 0; i < roles.Length; ++i) { m_roles[i] = roles[i]; } } else { m_roles = null; } } public virtual IIdentity Identity { get { return m_identity; } } public virtual bool IsInRole (string role) { if (role == null || m_roles == null) return false; for (int i = 0; i < m_roles.Length; ++i) { if (m_roles[i] != null && String.Compare(m_roles[i], role, StringComparison.OrdinalIgnoreCase) == 0) return true; } return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- LockedHandleGlyph.cs
- DeclarativeConditionsCollection.cs
- HttpClientProtocol.cs
- ImageField.cs
- SqlUtils.cs
- RectangleGeometry.cs
- PeerNode.cs
- BookmarkTable.cs
- FunctionImportMapping.cs
- EntityDataSourceStatementEditorForm.cs
- Calendar.cs
- DecoderReplacementFallback.cs
- DataRecordInternal.cs
- MethodSignatureGenerator.cs
- JoinSymbol.cs
- NetworkAddressChange.cs
- EdmProviderManifest.cs
- DataGridHelper.cs
- SpotLight.cs
- SqlClientFactory.cs
- OutputCacheModule.cs
- HtmlTable.cs
- HostingEnvironmentSection.cs
- WS2007FederationHttpBindingElement.cs
- Buffer.cs
- InfoCardClaimCollection.cs
- GridItem.cs
- SqlDataSourceParameterParser.cs
- FrameDimension.cs
- BamlMapTable.cs
- ConfigurationStrings.cs
- DesignerHost.cs
- BorderSidesEditor.cs
- PropertyChangedEventManager.cs
- TextDecorationLocationValidation.cs
- Fonts.cs
- SelectionItemPattern.cs
- HttpHeaderCollection.cs
- DuplicateWaitObjectException.cs
- DynamicAttribute.cs
- Compiler.cs
- ReflectTypeDescriptionProvider.cs
- ActivationArguments.cs
- CodeDelegateCreateExpression.cs
- GroupJoinQueryOperator.cs
- GeneratedView.cs
- _BaseOverlappedAsyncResult.cs
- MulticastOption.cs
- NetSectionGroup.cs
- XmlSchemaParticle.cs
- PeerNameRecord.cs
- CodePageUtils.cs
- SmtpMail.cs
- CheckedPointers.cs
- ProxyFragment.cs
- CounterSampleCalculator.cs
- ComponentGuaranteesAttribute.cs
- PlanCompilerUtil.cs
- ExpandSegment.cs
- DataObject.cs
- DependencyObjectValidator.cs
- CurrencyWrapper.cs
- XPathSingletonIterator.cs
- MouseActionConverter.cs
- LinearGradientBrush.cs
- NumberFormatter.cs
- EdmComplexTypeAttribute.cs
- PasswordTextNavigator.cs
- UnhandledExceptionEventArgs.cs
- InternalsVisibleToAttribute.cs
- TextAction.cs
- SQLDoubleStorage.cs
- PcmConverter.cs
- CodeGen.cs
- DataGridViewCellStyleChangedEventArgs.cs
- ADConnectionHelper.cs
- SchemaImporter.cs
- CompModSwitches.cs
- CommonObjectSecurity.cs
- DesignerCommandSet.cs
- SqlUtil.cs
- FontStretches.cs
- Journal.cs
- CompoundFileIOPermission.cs
- GenericWebPart.cs
- Size.cs
- FSWPathEditor.cs
- Panel.cs
- RegistrySecurity.cs
- CodeIdentifier.cs
- KeySpline.cs
- TypeDescriptionProvider.cs
- RoleManagerEventArgs.cs
- XmlBinaryReader.cs
- TwoPhaseCommit.cs
- CompilerCollection.cs
- ParallelEnumerableWrapper.cs
- NamespaceDisplay.xaml.cs
- FileLogRecordEnumerator.cs
- SizeAnimation.cs