Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / security / system / security / permissions / storepermissionattribute.cs / 1305376 / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ViewCellRelation.cs
- Authorization.cs
- QuotedPrintableStream.cs
- HtmlTextArea.cs
- BaseCodeDomTreeGenerator.cs
- Win32MouseDevice.cs
- Axis.cs
- ParseElement.cs
- ToggleProviderWrapper.cs
- BitmapCacheBrush.cs
- Blend.cs
- WebPart.cs
- KeyTimeConverter.cs
- ResourceProperty.cs
- SerialReceived.cs
- NavigationWindow.cs
- CodeIdentifiers.cs
- LicenseProviderAttribute.cs
- VirtualizedCellInfoCollection.cs
- BamlMapTable.cs
- HttpResponseHeader.cs
- XmlConvert.cs
- DebugHandleTracker.cs
- UnsafeNativeMethods.cs
- DataGridViewElement.cs
- PerformanceCounter.cs
- MissingMethodException.cs
- FontSource.cs
- PlanCompilerUtil.cs
- ListViewHitTestInfo.cs
- ApplicationServiceHelper.cs
- WeakReferenceKey.cs
- NumericUpDown.cs
- DataGridViewCellStyle.cs
- BaseProcessor.cs
- WebControlsSection.cs
- RelationshipEnd.cs
- WebOperationContext.cs
- ByteArrayHelperWithString.cs
- SystemTcpConnection.cs
- RtfControls.cs
- ControlBuilder.cs
- RichTextBoxConstants.cs
- SoapMessage.cs
- BinaryReader.cs
- OutOfMemoryException.cs
- StrongNamePublicKeyBlob.cs
- AdPostCacheSubstitution.cs
- DurationConverter.cs
- DeviceSpecificDesigner.cs
- RuntimeTransactionHandle.cs
- MSAAWinEventWrap.cs
- SamlSecurityToken.cs
- ProgressBarHighlightConverter.cs
- XmlNodeComparer.cs
- SQLBinary.cs
- TagNameToTypeMapper.cs
- WebPartDescription.cs
- MetadataArtifactLoaderCompositeFile.cs
- SecurityTokenParametersEnumerable.cs
- TimeoutValidationAttribute.cs
- SmiSettersStream.cs
- HtmlTableRowCollection.cs
- NativeObjectSecurity.cs
- XamlHostingSection.cs
- ToolStripOverflow.cs
- ReadOnlyHierarchicalDataSource.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- TextRenderer.cs
- Utils.cs
- SecurityTokenException.cs
- XmlSchemaSimpleContentExtension.cs
- RadioButtonRenderer.cs
- InstalledFontCollection.cs
- TextEffect.cs
- Brush.cs
- PropertyIDSet.cs
- HostingEnvironmentSection.cs
- EmptyQuery.cs
- BehaviorService.cs
- GeometryDrawing.cs
- CustomPopupPlacement.cs
- DataGridrowEditEndingEventArgs.cs
- SettingsBase.cs
- AssemblyAttributes.cs
- Int32.cs
- WebPartConnection.cs
- XPathDocumentIterator.cs
- IpcClientManager.cs
- MessageSecurityOverTcpElement.cs
- RemoveStoryboard.cs
- LeafCellTreeNode.cs
- MobileControlDesigner.cs
- XmlAttributeProperties.cs
- XmlSchemaAttribute.cs
- _Rfc2616CacheValidators.cs
- WebPartZoneBase.cs
- WebPartVerb.cs
- MemberCollection.cs
- sqlser.cs