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
- RelatedEnd.cs
- WebPartActionVerb.cs
- Choices.cs
- UICuesEvent.cs
- ClientFormsAuthenticationMembershipProvider.cs
- XomlCompiler.cs
- HeaderCollection.cs
- DisplayMemberTemplateSelector.cs
- SiteMapNodeCollection.cs
- MessageEncoderFactory.cs
- PatternMatcher.cs
- DataGridViewCellStyleChangedEventArgs.cs
- KeyPullup.cs
- HitTestFilterBehavior.cs
- SqlDataSourceEnumerator.cs
- SevenBitStream.cs
- DBCommandBuilder.cs
- DragCompletedEventArgs.cs
- InternalSafeNativeMethods.cs
- DecimalConstantAttribute.cs
- ToolboxComponentsCreatingEventArgs.cs
- DisplayInformation.cs
- SqlDataSourceCache.cs
- ContentTextAutomationPeer.cs
- ContentPosition.cs
- OracleRowUpdatingEventArgs.cs
- COM2Properties.cs
- GeneratedCodeAttribute.cs
- EntityDataSourceState.cs
- ConfigurationStrings.cs
- UnicastIPAddressInformationCollection.cs
- DataGridViewLinkCell.cs
- TreeNode.cs
- COM2FontConverter.cs
- ReadOnlyHierarchicalDataSource.cs
- ControlEvent.cs
- XmlLoader.cs
- DurableInstanceProvider.cs
- CollectionViewGroupInternal.cs
- NamespaceList.cs
- CryptoApi.cs
- ValidationManager.cs
- AlignmentXValidation.cs
- InternalPermissions.cs
- ConnectionInterfaceCollection.cs
- BamlStream.cs
- CompositeCollection.cs
- XmlBinaryReader.cs
- WindowsToolbarItemAsMenuItem.cs
- HashAlgorithm.cs
- CustomAttributeFormatException.cs
- MenuItemCollectionEditor.cs
- HtmlAnchor.cs
- InputGestureCollection.cs
- ScrollEvent.cs
- ImageList.cs
- ListViewInsertedEventArgs.cs
- SHA384Managed.cs
- SqlConnection.cs
- QilLoop.cs
- DoubleSumAggregationOperator.cs
- SecurityTokenSerializer.cs
- TextParagraphView.cs
- SchemaImporterExtensionElement.cs
- InputGestureCollection.cs
- HtmlImageAdapter.cs
- SqlResolver.cs
- RegexBoyerMoore.cs
- WebPartVerb.cs
- EncodingTable.cs
- HttpAsyncResult.cs
- UnmanagedMemoryStream.cs
- DataGridViewSelectedRowCollection.cs
- WebRequestModuleElementCollection.cs
- ServiceEndpointElement.cs
- Accessible.cs
- WebPartCatalogCloseVerb.cs
- RepeatInfo.cs
- UnsafeNativeMethods.cs
- ToolStripLabel.cs
- HostingEnvironmentWrapper.cs
- DefaultPropertiesToSend.cs
- PageAction.cs
- Image.cs
- MimeTypeAttribute.cs
- MULTI_QI.cs
- DateTimeFormat.cs
- XmlSchemaGroup.cs
- HttpBufferlessInputStream.cs
- PropertyCollection.cs
- ThreadPool.cs
- SqlClientFactory.cs
- DataGridViewDataErrorEventArgs.cs
- StaticSiteMapProvider.cs
- ButtonBaseAutomationPeer.cs
- MouseOverProperty.cs
- PlatformCulture.cs
- SecurityUtils.cs
- Vector3DCollection.cs
- PropertyChangedEventManager.cs