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
- SessionStateContainer.cs
- WebConfigurationHost.cs
- InvalidPrinterException.cs
- WsdlEndpointConversionContext.cs
- TypeGeneratedEventArgs.cs
- SystemIcmpV4Statistics.cs
- securitycriticaldataClass.cs
- TextParagraph.cs
- TableDetailsCollection.cs
- PropertyValue.cs
- MetabaseServerConfig.cs
- GiveFeedbackEventArgs.cs
- PathFigureCollection.cs
- OutputCacheProviderCollection.cs
- ProcessHost.cs
- StandardToolWindows.cs
- PeerTransportSecurityElement.cs
- TableAdapterManagerGenerator.cs
- Context.cs
- HMACSHA1.cs
- FontStretch.cs
- NotSupportedException.cs
- FilterFactory.cs
- XmlQueryTypeFactory.cs
- DataServiceQueryProvider.cs
- RsaSecurityKey.cs
- X509ScopedServiceCertificateElementCollection.cs
- QueryNode.cs
- MemberPathMap.cs
- Int16KeyFrameCollection.cs
- XmlSerializerNamespaces.cs
- RuleSetBrowserDialog.cs
- DriveNotFoundException.cs
- HostingEnvironment.cs
- RubberbandSelector.cs
- ItemsPresenter.cs
- ImmutableObjectAttribute.cs
- WorkflowClientDeliverMessageWrapper.cs
- MemberHolder.cs
- BaseParaClient.cs
- SafeReversePInvokeHandle.cs
- WindowInteractionStateTracker.cs
- RuntimeWrappedException.cs
- MaxValueConverter.cs
- NetworkCredential.cs
- SchemaTableOptionalColumn.cs
- ApplicationServiceManager.cs
- BoundColumn.cs
- ipaddressinformationcollection.cs
- MobileSysDescriptionAttribute.cs
- securitycriticaldataClass.cs
- EntityDataSourceViewSchema.cs
- NativeMethods.cs
- TextTreeNode.cs
- LocalFileSettingsProvider.cs
- VectorCollection.cs
- ParserHooks.cs
- XmlCodeExporter.cs
- ObjectContext.cs
- EdmEntityTypeAttribute.cs
- ScalarType.cs
- CharacterMetricsDictionary.cs
- panel.cs
- SafeCertificateContext.cs
- SystemSounds.cs
- ManualResetEvent.cs
- UriParserTemplates.cs
- Schedule.cs
- TypeListConverter.cs
- XamlToRtfParser.cs
- TogglePatternIdentifiers.cs
- ModuleConfigurationInfo.cs
- ForEachDesigner.xaml.cs
- BasicCellRelation.cs
- SoapElementAttribute.cs
- DataRecordObjectView.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- SqlBuilder.cs
- DebugHandleTracker.cs
- ExpandCollapsePattern.cs
- MonitorWrapper.cs
- IndentTextWriter.cs
- CategoryGridEntry.cs
- CodeTypeReferenceCollection.cs
- ToolStripItemRenderEventArgs.cs
- ObjectDataSourceView.cs
- HttpApplication.cs
- PropertySourceInfo.cs
- StorageRoot.cs
- CopyOnWriteList.cs
- DecoderBestFitFallback.cs
- MulticastIPAddressInformationCollection.cs
- x509utils.cs
- DeviceSpecificDesigner.cs
- CqlBlock.cs
- UserCancellationException.cs
- ImageConverter.cs
- RepeaterItemCollection.cs
- LoginUtil.cs
- DrawingContext.cs