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
- PackageRelationshipSelector.cs
- LateBoundBitmapDecoder.cs
- XsdBuilder.cs
- FileDialogPermission.cs
- WebControlAdapter.cs
- ListBase.cs
- PtsContext.cs
- ConfigXmlReader.cs
- ProvidersHelper.cs
- Rect.cs
- AnnotationHelper.cs
- Semaphore.cs
- StorageModelBuildProvider.cs
- SynchronizationLockException.cs
- DataGridViewImageColumn.cs
- LoginName.cs
- XmlProcessingInstruction.cs
- TextAutomationPeer.cs
- StrongNameUtility.cs
- ChannelOptions.cs
- OperandQuery.cs
- UrlAuthorizationModule.cs
- WCFServiceClientProxyGenerator.cs
- XpsPartBase.cs
- IOThreadScheduler.cs
- MessageDirection.cs
- WorkflowEnvironment.cs
- ScriptingProfileServiceSection.cs
- Regex.cs
- ItemMap.cs
- WindowsScroll.cs
- GeometryHitTestResult.cs
- DataGridViewTopRowAccessibleObject.cs
- DataServiceResponse.cs
- DictionaryContent.cs
- WebPartActionVerb.cs
- DnsPermission.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- X509Utils.cs
- ContravarianceAdapter.cs
- _Win32.cs
- FormsAuthenticationUser.cs
- DataGridViewRowCollection.cs
- LayoutEvent.cs
- VirtualDirectoryMapping.cs
- ObjectTypeMapping.cs
- Attachment.cs
- MenuItemBindingCollection.cs
- InstancePersistenceContext.cs
- TraceSource.cs
- HighContrastHelper.cs
- Event.cs
- DoubleCollection.cs
- BoundsDrawingContextWalker.cs
- BaseInfoTable.cs
- TimelineGroup.cs
- FilterableAttribute.cs
- Activator.cs
- RawStylusInputCustomDataList.cs
- SchemaEntity.cs
- TextRangeBase.cs
- AttributedMetaModel.cs
- PerspectiveCamera.cs
- AuthenticationService.cs
- GeneratedContractType.cs
- SystemColorTracker.cs
- DesignerCalendarAdapter.cs
- DataGridViewTextBoxCell.cs
- ClosableStream.cs
- ServiceOperationWrapper.cs
- JoinElimination.cs
- TextEditorTyping.cs
- ButtonRenderer.cs
- InkPresenter.cs
- SoapHttpTransportImporter.cs
- WebEventTraceProvider.cs
- OleDbErrorCollection.cs
- ScriptIgnoreAttribute.cs
- EdmSchemaError.cs
- DBDataPermissionAttribute.cs
- ReferenceAssemblyAttribute.cs
- ValueTable.cs
- MarkupCompilePass2.cs
- ImageCodecInfo.cs
- MsmqInputSessionChannel.cs
- ErasingStroke.cs
- TypeUtil.cs
- AssertSection.cs
- DataGridViewSelectedColumnCollection.cs
- SiteMapNodeItemEventArgs.cs
- RoamingStoreFile.cs
- ModifiableIteratorCollection.cs
- HandlerBase.cs
- XmlSchemaAny.cs
- FieldBuilder.cs
- HtmlToClrEventProxy.cs
- ResetableIterator.cs
- InternalControlCollection.cs
- ToolStripSettings.cs
- _emptywebproxy.cs