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
- WorkflowEnvironment.cs
- ToolStripHighContrastRenderer.cs
- TreeBuilderBamlTranslator.cs
- BufferedStream.cs
- ApplicationSecurityManager.cs
- SerialPort.cs
- HideDisabledControlAdapter.cs
- Light.cs
- GridItemPattern.cs
- CornerRadiusConverter.cs
- SparseMemoryStream.cs
- CodeComment.cs
- DataBoundControlHelper.cs
- StylusPointPropertyUnit.cs
- InvalidateEvent.cs
- NativeObjectSecurity.cs
- ControlOperationBehavior.cs
- Tokenizer.cs
- AudioBase.cs
- ShowExpandedMultiValueConverter.cs
- SurrogateSelector.cs
- XmlSerializationGeneratedCode.cs
- CodeSubDirectory.cs
- SignedXml.cs
- WebPartConnectionCollection.cs
- HostedTransportConfigurationBase.cs
- ConstraintEnumerator.cs
- FixedSOMTableCell.cs
- StateDesigner.Layouts.cs
- AsymmetricSignatureFormatter.cs
- LogicalExpr.cs
- Frame.cs
- SecureEnvironment.cs
- SqlMethodTransformer.cs
- AutoSizeComboBox.cs
- PrivacyNoticeBindingElement.cs
- ActivityPreviewDesigner.cs
- MemberAssignmentAnalysis.cs
- SqlDataSourceCache.cs
- ListItemsPage.cs
- PropertyItemInternal.cs
- ObjectDataSourceMethodEventArgs.cs
- InstanceData.cs
- DataChangedEventManager.cs
- InstanceKeyNotReadyException.cs
- RelatedCurrencyManager.cs
- RequestDescription.cs
- CodeGenerator.cs
- DataList.cs
- Condition.cs
- SimpleTypesSurrogate.cs
- GestureRecognitionResult.cs
- ResXBuildProvider.cs
- ConstraintCollection.cs
- FlowDocumentPaginator.cs
- _HeaderInfo.cs
- Blend.cs
- InlineUIContainer.cs
- x509utils.cs
- ManipulationLogic.cs
- QueryOperationResponseOfT.cs
- UpdateProgress.cs
- MdiWindowListStrip.cs
- XmlNamespaceDeclarationsAttribute.cs
- RowType.cs
- DebugTrace.cs
- SqlTrackingService.cs
- NativeMethods.cs
- WebService.cs
- OdbcUtils.cs
- Grant.cs
- NativeMethodsOther.cs
- IHttpResponseInternal.cs
- CrossAppDomainChannel.cs
- SimpleType.cs
- XmlSchemaObjectCollection.cs
- List.cs
- IItemContainerGenerator.cs
- BulletedListDesigner.cs
- MenuAdapter.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- EditorBrowsableAttribute.cs
- XmlArrayItemAttribute.cs
- BindingOperations.cs
- AspNetCompatibilityRequirementsMode.cs
- SynchronousChannelMergeEnumerator.cs
- Pair.cs
- SynchronizedDispatch.cs
- PropertyStore.cs
- BitmapPalette.cs
- PageThemeBuildProvider.cs
- PictureBox.cs
- InstanceHandleReference.cs
- IncrementalCompileAnalyzer.cs
- InputScope.cs
- SafeBitVector32.cs
- DataGridRow.cs
- StylusShape.cs
- CacheHelper.cs
- FixedPageAutomationPeer.cs