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
- PolyQuadraticBezierSegment.cs
- arabicshape.cs
- SafeHandle.cs
- XmlSchemaInferenceException.cs
- PageAdapter.cs
- InvalidComObjectException.cs
- ClientUtils.cs
- FileLevelControlBuilderAttribute.cs
- SqlEnums.cs
- BridgeDataRecord.cs
- ObjectTag.cs
- GeneralTransform3DCollection.cs
- AssemblyBuilderData.cs
- ReferencedCollectionType.cs
- LicenseContext.cs
- HtmlInputControl.cs
- ControlParameter.cs
- CharConverter.cs
- RequestCachePolicy.cs
- panel.cs
- IImplicitResourceProvider.cs
- TextRenderingModeValidation.cs
- TimeSpanStorage.cs
- PageBuildProvider.cs
- EntityDataSourceWizardForm.cs
- Config.cs
- WebPartDescription.cs
- NetworkAddressChange.cs
- HandlerBase.cs
- Journaling.cs
- QueryOptionExpression.cs
- UInt64Converter.cs
- ElapsedEventArgs.cs
- ConnectionStringSettings.cs
- XPathChildIterator.cs
- DataServiceSaveChangesEventArgs.cs
- StylusShape.cs
- GridViewDeleteEventArgs.cs
- ReadContentAsBinaryHelper.cs
- BaseParaClient.cs
- MenuItemCollection.cs
- AVElementHelper.cs
- FullTextLine.cs
- DynamicResourceExtension.cs
- SymbolMethod.cs
- infer.cs
- LostFocusEventManager.cs
- CuspData.cs
- WindowsContainer.cs
- DrawingVisualDrawingContext.cs
- ImageListStreamer.cs
- OdbcFactory.cs
- NCryptSafeHandles.cs
- InvalidOperationException.cs
- ControlIdConverter.cs
- XmlCharacterData.cs
- BuildProviderUtils.cs
- IpcChannel.cs
- RecipientServiceModelSecurityTokenRequirement.cs
- SecurityRuntime.cs
- RegistryPermission.cs
- PolyLineSegment.cs
- DataContractSerializer.cs
- PatternMatcher.cs
- ImageInfo.cs
- InstanceKeyView.cs
- FontCollection.cs
- XsdDuration.cs
- VideoDrawing.cs
- ColumnWidthChangingEvent.cs
- CellTreeSimplifier.cs
- WebPartMinimizeVerb.cs
- EdmSchemaAttribute.cs
- PropertyIDSet.cs
- SendOperation.cs
- OlePropertyStructs.cs
- FlowDocumentReader.cs
- mediapermission.cs
- DbParameterCollectionHelper.cs
- AppDomainGrammarProxy.cs
- ScriptResourceInfo.cs
- DocumentPageView.cs
- InfoCardKeyedHashAlgorithm.cs
- SortKey.cs
- TreeWalkHelper.cs
- SizeLimitedCache.cs
- RijndaelManaged.cs
- WorkflowCompensationBehavior.cs
- ExpressionBinding.cs
- ThreadSafeList.cs
- HttpVersion.cs
- SqlClientFactory.cs
- SystemTcpStatistics.cs
- ReceiveMessageRecord.cs
- PartialCachingAttribute.cs
- CalendarDay.cs
- URLMembershipCondition.cs
- AssemblyLoader.cs
- PreviewKeyDownEventArgs.cs
- ServiceSecurityAuditElement.cs