Code:
/ DotNET / DotNET / 8.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
- SQLBinary.cs
- Mutex.cs
- StreamWriter.cs
- RectangleF.cs
- ExceptionUtility.cs
- ThreadSafeList.cs
- AssociationType.cs
- WebPartTransformerAttribute.cs
- StrongNameIdentityPermission.cs
- DependencyPropertyConverter.cs
- SocketInformation.cs
- CodeVariableReferenceExpression.cs
- ControlBindingsConverter.cs
- ValidationPropertyAttribute.cs
- HttpPostedFile.cs
- PlaceHolder.cs
- PropertyPathWorker.cs
- HierarchicalDataSourceDesigner.cs
- IdnMapping.cs
- GradientPanel.cs
- TextRunCache.cs
- Crypto.cs
- ExtendedPropertyDescriptor.cs
- DataServiceStreamResponse.cs
- UdpSocketReceiveManager.cs
- OutputCacheSettings.cs
- ModelPropertyImpl.cs
- RequestCachingSection.cs
- ConfigurationElementCollection.cs
- DateTimePicker.cs
- OleDbRowUpdatingEvent.cs
- WebPartTransformerCollection.cs
- TemplateControlBuildProvider.cs
- Vector.cs
- ItemContainerProviderWrapper.cs
- ConfigurationException.cs
- StructuralComparisons.cs
- X509Chain.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- ExpressionNormalizer.cs
- SoapAttributes.cs
- Material.cs
- Message.cs
- Authorization.cs
- SerTrace.cs
- ReadContentAsBinaryHelper.cs
- OdbcEnvironmentHandle.cs
- MessageDesigner.cs
- BigInt.cs
- MsmqNonTransactedPoisonHandler.cs
- DragAssistanceManager.cs
- SerializationStore.cs
- ListCollectionView.cs
- SafeNativeMethods.cs
- OpenFileDialog.cs
- ApplicationManager.cs
- ReflectionPermission.cs
- ExpressionParser.cs
- DateTimeSerializationSection.cs
- MruCache.cs
- Stacktrace.cs
- ContentPresenter.cs
- _AuthenticationState.cs
- DataGridViewAutoSizeModeEventArgs.cs
- WmpBitmapEncoder.cs
- TypeDescriptionProvider.cs
- XsdBuildProvider.cs
- APCustomTypeDescriptor.cs
- MatrixAnimationUsingPath.cs
- EntityDataSourceWizardForm.cs
- XPathDocumentNavigator.cs
- MarkupExtensionParser.cs
- MsmqHostedTransportManager.cs
- EntityContainerEntitySetDefiningQuery.cs
- Parser.cs
- FormViewDeletedEventArgs.cs
- XmlObjectSerializerReadContextComplexJson.cs
- TextDecoration.cs
- OleDbReferenceCollection.cs
- FillErrorEventArgs.cs
- EnumValidator.cs
- WebBrowserHelper.cs
- StringExpressionSet.cs
- RegistrationServices.cs
- TextLineBreak.cs
- Line.cs
- MarkedHighlightComponent.cs
- mediaeventshelper.cs
- Statements.cs
- TriggerBase.cs
- FileLoadException.cs
- JoinSymbol.cs
- VirtualDirectoryMapping.cs
- wmiprovider.cs
- Debug.cs
- SafeEventHandle.cs
- FileCodeGroup.cs
- Line.cs
- DesignerOptionService.cs
- PasswordTextNavigator.cs