Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / security / system / security / permissions / storepermissionattribute.cs / 1 / storepermissionattribute.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // StorePermissionAttribute.cs // namespace System.Security.Permissions { [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )] [Serializable()] public sealed class StorePermissionAttribute : CodeAccessSecurityAttribute { StorePermissionFlags m_flags = StorePermissionFlags.NoFlags; public StorePermissionAttribute(SecurityAction action) : base(action) {} public StorePermissionFlags Flags { get { return m_flags; } set { StorePermission.VerifyFlags(value); m_flags = value; } } public bool CreateStore { get { return (m_flags & StorePermissionFlags.CreateStore) != 0; } set { m_flags = value ? m_flags | StorePermissionFlags.CreateStore : m_flags & ~StorePermissionFlags.CreateStore; } } public bool DeleteStore { get { return (m_flags & StorePermissionFlags.DeleteStore) != 0; } set { m_flags = value ? m_flags | StorePermissionFlags.DeleteStore : m_flags & ~StorePermissionFlags.DeleteStore; } } public bool EnumerateStores { get { return (m_flags & StorePermissionFlags.EnumerateStores) != 0; } set { m_flags = value ? m_flags | StorePermissionFlags.EnumerateStores : m_flags & ~StorePermissionFlags.EnumerateStores; } } public bool OpenStore { get { return (m_flags & StorePermissionFlags.OpenStore) != 0; } set { m_flags = value ? m_flags | StorePermissionFlags.OpenStore : m_flags & ~StorePermissionFlags.OpenStore; } } public bool AddToStore { get { return (m_flags & StorePermissionFlags.AddToStore) != 0; } set { m_flags = value ? m_flags | StorePermissionFlags.AddToStore : m_flags & ~StorePermissionFlags.AddToStore; } } public bool RemoveFromStore { get { return (m_flags & StorePermissionFlags.RemoveFromStore) != 0; } set { m_flags = value ? m_flags | StorePermissionFlags.RemoveFromStore : m_flags & ~StorePermissionFlags.RemoveFromStore; } } public bool EnumerateCertificates { get { return (m_flags & StorePermissionFlags.EnumerateCertificates) != 0; } set { m_flags = value ? m_flags | StorePermissionFlags.EnumerateCertificates : m_flags & ~StorePermissionFlags.EnumerateCertificates; } } public override IPermission CreatePermission() { if (Unrestricted) return new StorePermission(PermissionState.Unrestricted); else return new StorePermission(m_flags); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- COM2DataTypeToManagedDataTypeConverter.cs
- UndirectedGraph.cs
- basecomparevalidator.cs
- SimpleBitVector32.cs
- ExceptionUtil.cs
- SplitterEvent.cs
- PriorityChain.cs
- DataControlField.cs
- DataGridViewCellStateChangedEventArgs.cs
- TypeUnloadedException.cs
- DataSourceCacheDurationConverter.cs
- DataGridViewBand.cs
- FormViewRow.cs
- ProgressPage.cs
- TypedReference.cs
- ServiceDescriptionImporter.cs
- ProfileServiceManager.cs
- CellTreeSimplifier.cs
- HttpContextBase.cs
- HwndMouseInputProvider.cs
- Trace.cs
- DiscreteKeyFrames.cs
- DataControlCommands.cs
- DelegateSerializationHolder.cs
- UIElement3D.cs
- _Events.cs
- GPStream.cs
- ButtonBase.cs
- StateBag.cs
- AnchorEditor.cs
- ApplicationServicesHostFactory.cs
- ScrollEventArgs.cs
- WindowCollection.cs
- GridViewSelectEventArgs.cs
- ProjectionPruner.cs
- DisplayInformation.cs
- SkewTransform.cs
- XmlObjectSerializerWriteContext.cs
- StylusTip.cs
- keycontainerpermission.cs
- ArraySubsetEnumerator.cs
- IfJoinedCondition.cs
- EdmValidator.cs
- EndpointIdentityExtension.cs
- SmtpFailedRecipientException.cs
- HMACSHA384.cs
- DeploymentSection.cs
- WebPartEditorOkVerb.cs
- MappedMetaModel.cs
- ModuleBuilderData.cs
- GridViewCancelEditEventArgs.cs
- FilterQuery.cs
- CategoryGridEntry.cs
- GenerateTemporaryTargetAssembly.cs
- ProfilePropertyNameValidator.cs
- RefreshEventArgs.cs
- PositiveTimeSpanValidator.cs
- InputScopeConverter.cs
- SafeCoTaskMem.cs
- DirtyTextRange.cs
- NativeActivityContext.cs
- TextTreeFixupNode.cs
- GeneralTransformCollection.cs
- DataGridRow.cs
- VirtualizedItemPattern.cs
- ElementMarkupObject.cs
- DesignerSerializerAttribute.cs
- VirtualPath.cs
- StatusBarItemAutomationPeer.cs
- VersionedStreamOwner.cs
- MemberHolder.cs
- TextTreeTextBlock.cs
- FixedSchema.cs
- IntSumAggregationOperator.cs
- MetadataItemSerializer.cs
- Int32CollectionConverter.cs
- X509Utils.cs
- OdbcDataAdapter.cs
- AttributedMetaModel.cs
- ScrollBarRenderer.cs
- NamespaceCollection.cs
- SizeConverter.cs
- MultipartContentParser.cs
- NoneExcludedImageIndexConverter.cs
- UnaryQueryOperator.cs
- MatchingStyle.cs
- Vector3DConverter.cs
- Mutex.cs
- ToolBarButton.cs
- ArgumentException.cs
- TableProviderWrapper.cs
- OptimisticConcurrencyException.cs
- InlineCollection.cs
- pingexception.cs
- SchemaDeclBase.cs
- ErrorWrapper.cs
- PassportPrincipal.cs
- HttpRawResponse.cs
- WebConfigurationManager.cs
- ContainerParagraph.cs