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
- RowParagraph.cs
- ConfigurationCollectionAttribute.cs
- Timer.cs
- ClientOperationFormatterProvider.cs
- TransformationRules.cs
- ResourceDisplayNameAttribute.cs
- MsmqAppDomainProtocolHandler.cs
- XslVisitor.cs
- SafeCoTaskMem.cs
- ToolStripGrip.cs
- TypeLoadException.cs
- DataGridViewSortCompareEventArgs.cs
- _WinHttpWebProxyDataBuilder.cs
- OdbcErrorCollection.cs
- FacetDescription.cs
- TCEAdapterGenerator.cs
- SoapInteropTypes.cs
- AnnotationAdorner.cs
- CellQuery.cs
- DataGridViewRow.cs
- TimeZone.cs
- ScriptControlDescriptor.cs
- SmiEventStream.cs
- Attributes.cs
- DialogResultConverter.cs
- SymbolEqualComparer.cs
- WebMethodAttribute.cs
- VectorConverter.cs
- Pointer.cs
- SHA256.cs
- latinshape.cs
- MDIControlStrip.cs
- SQLDecimalStorage.cs
- BitmapVisualManager.cs
- EventLogPermissionEntry.cs
- WindowClosedEventArgs.cs
- DefaultMemberAttribute.cs
- Matrix.cs
- EventSinkHelperWriter.cs
- DefaultClaimSet.cs
- RuntimeConfigLKG.cs
- PackagePart.cs
- Int32CAMarshaler.cs
- CompilationUtil.cs
- UpdateManifestForBrowserApplication.cs
- FilteredAttributeCollection.cs
- NativeMethods.cs
- Expression.DebuggerProxy.cs
- CapabilitiesAssignment.cs
- StaticSiteMapProvider.cs
- TypeConverterHelper.cs
- XDeferredAxisSource.cs
- DefaultWorkflowSchedulerService.cs
- TypeExtensionConverter.cs
- ServiceModelActivationSectionGroup.cs
- DataFormat.cs
- TextParagraphProperties.cs
- ConfigurationErrorsException.cs
- InvalidWMPVersionException.cs
- BaseConfigurationRecord.cs
- SafeRightsManagementHandle.cs
- ConfigurationErrorsException.cs
- GridView.cs
- SharedUtils.cs
- ImageMap.cs
- UnsafeNativeMethodsTablet.cs
- PrintPageEvent.cs
- UrlEncodedParameterWriter.cs
- GeometryCollection.cs
- ObjectQueryExecutionPlan.cs
- Label.cs
- SecurityHelper.cs
- DbQueryCommandTree.cs
- TypeCodeDomSerializer.cs
- CrossAppDomainChannel.cs
- AmbiguousMatchException.cs
- PieceNameHelper.cs
- BuiltInExpr.cs
- XmlDataContract.cs
- XmlTypeAttribute.cs
- EntityTypeEmitter.cs
- SimpleHandlerBuildProvider.cs
- LabelDesigner.cs
- InitializationEventAttribute.cs
- GraphicsContainer.cs
- NullExtension.cs
- IndexingContentUnit.cs
- WSTrustDec2005.cs
- ResponseStream.cs
- DependentList.cs
- DataServiceQueryProvider.cs
- AssemblyBuilder.cs
- _DisconnectOverlappedAsyncResult.cs
- XPathItem.cs
- SolidBrush.cs
- ContainerUtilities.cs
- FlowDocumentPage.cs
- XmlWhitespace.cs
- XmlSchemaSimpleContent.cs
- XmlWriterSettings.cs