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
- PrintController.cs
- VisualTreeUtils.cs
- DispatcherHookEventArgs.cs
- HttpApplicationFactory.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- EditorZone.cs
- Point.cs
- BrowserDefinitionCollection.cs
- Rotation3DKeyFrameCollection.cs
- GroupBox.cs
- DataKey.cs
- RelationshipConverter.cs
- WmpBitmapEncoder.cs
- TextComposition.cs
- TrackBarRenderer.cs
- Byte.cs
- ReadOnlyTernaryTree.cs
- SqlDataRecord.cs
- ComponentConverter.cs
- SpotLight.cs
- FormView.cs
- CheckBoxField.cs
- DBConcurrencyException.cs
- SQLRoleProvider.cs
- SystemTcpConnection.cs
- ArcSegment.cs
- RemoteWebConfigurationHostStream.cs
- PartialTrustVisibleAssembliesSection.cs
- TagPrefixInfo.cs
- CursorConverter.cs
- DataGridViewTextBoxColumn.cs
- PrinterResolution.cs
- DLinqDataModelProvider.cs
- OutputCacheSection.cs
- DataGridColumnHeaderCollection.cs
- AdornerPresentationContext.cs
- LocationSectionRecord.cs
- DataTableCollection.cs
- HandlerMappingMemo.cs
- XAMLParseException.cs
- WebCategoryAttribute.cs
- DrawingVisual.cs
- SqlUnionizer.cs
- BinaryMessageFormatter.cs
- FontWeightConverter.cs
- AbandonedMutexException.cs
- EncoderFallback.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- ServicePoint.cs
- OleDbParameterCollection.cs
- FixedSOMSemanticBox.cs
- CompiledXpathExpr.cs
- PermissionSetEnumerator.cs
- InfoCardKeyedHashAlgorithm.cs
- ClientBuildManagerCallback.cs
- Rotation3DKeyFrameCollection.cs
- ValidateNames.cs
- ConfigurationSectionGroup.cs
- Parameter.cs
- InternalDuplexChannelFactory.cs
- ArgumentNullException.cs
- PhonemeEventArgs.cs
- ResourceExpressionEditorSheet.cs
- InvalidCommandTreeException.cs
- CurrentChangedEventManager.cs
- _ProxyChain.cs
- EntityContainerEmitter.cs
- DataGridViewTopRowAccessibleObject.cs
- ComplexTypeEmitter.cs
- InputScopeManager.cs
- CodeExpressionRuleDeclaration.cs
- PathGradientBrush.cs
- ContentIterators.cs
- DbDataRecord.cs
- Geometry3D.cs
- AnnotationResourceCollection.cs
- HttpsHostedTransportConfiguration.cs
- MaskPropertyEditor.cs
- EntityStoreSchemaFilterEntry.cs
- Lasso.cs
- TrackingProfileDeserializationException.cs
- SvcMapFileLoader.cs
- DataGridViewCellStyle.cs
- SafeMILHandleMemoryPressure.cs
- XmlArrayAttribute.cs
- Error.cs
- FileInfo.cs
- JoinSymbol.cs
- UriTemplateVariablePathSegment.cs
- ParallelTimeline.cs
- XmlBinaryWriterSession.cs
- ThreadSafeList.cs
- XmlIncludeAttribute.cs
- DataObject.cs
- DoubleStorage.cs
- ColorInterpolationModeValidation.cs
- ErrorWrapper.cs
- SecurityElement.cs
- DispatcherHooks.cs
- IList.cs