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
- ServiceDescription.cs
- ProjectionCamera.cs
- DoubleLinkList.cs
- BaseConfigurationRecord.cs
- SharedStatics.cs
- DropShadowEffect.cs
- AmbientEnvironment.cs
- ToolStripDropDownClosedEventArgs.cs
- RegistrySecurity.cs
- DesignerTextWriter.cs
- SmiRequestExecutor.cs
- ManagedIStream.cs
- NamespaceMapping.cs
- Models.cs
- RightsDocument.cs
- CommandPlan.cs
- TextSchema.cs
- AsyncPostBackTrigger.cs
- CodeTypeReferenceExpression.cs
- InvokePattern.cs
- ProgressiveCrcCalculatingStream.cs
- MethodCallTranslator.cs
- ArrayElementGridEntry.cs
- SocketInformation.cs
- VisualStyleTypesAndProperties.cs
- TouchFrameEventArgs.cs
- CreationContext.cs
- QueryCacheEntry.cs
- Selection.cs
- SQLMembershipProvider.cs
- DataGridViewDataErrorEventArgs.cs
- IBuiltInEvidence.cs
- OdbcTransaction.cs
- SiteMapNodeCollection.cs
- TextRangeEditTables.cs
- PrintPageEvent.cs
- Parameter.cs
- CacheChildrenQuery.cs
- FileNotFoundException.cs
- XmlSerializationGeneratedCode.cs
- CodeComment.cs
- InternalControlCollection.cs
- SocketPermission.cs
- CorrelationToken.cs
- LinearGradientBrush.cs
- CheckBoxPopupAdapter.cs
- AnnotationComponentManager.cs
- coordinator.cs
- ProxyGenerator.cs
- Condition.cs
- StorageTypeMapping.cs
- iisPickupDirectory.cs
- ModelUIElement3D.cs
- TemplatedEditableDesignerRegion.cs
- NamedPipeProcessProtocolHandler.cs
- SettingsSavedEventArgs.cs
- Tracking.cs
- SecurityRuntime.cs
- XmlReaderSettings.cs
- SemaphoreSecurity.cs
- ComNativeDescriptor.cs
- RequestCacheManager.cs
- TransformCryptoHandle.cs
- SessionEndingCancelEventArgs.cs
- ElementAction.cs
- SurrogateEncoder.cs
- HwndSourceParameters.cs
- SchemaLookupTable.cs
- SubMenuStyleCollection.cs
- SafeEventLogReadHandle.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- ToolStripAdornerWindowService.cs
- ConfigXmlSignificantWhitespace.cs
- ErrorWebPart.cs
- RTTypeWrapper.cs
- FormatConvertedBitmap.cs
- MultipleViewProviderWrapper.cs
- DependencyPropertyDescriptor.cs
- ActivityCodeDomReferenceService.cs
- ItemCollection.cs
- FieldToken.cs
- Ipv6Element.cs
- SmtpDateTime.cs
- ReadOnlyAttribute.cs
- ExpressionConverter.cs
- ObjectQuery.cs
- ResponseBodyWriter.cs
- _NetworkingPerfCounters.cs
- DataObjectAttribute.cs
- TouchFrameEventArgs.cs
- ProxyManager.cs
- DependencyObject.cs
- DecimalStorage.cs
- ComboBox.cs
- InputScopeManager.cs
- EntityProxyFactory.cs
- WebPartEditVerb.cs
- LinqDataSourceEditData.cs
- CustomLineCap.cs
- DataBoundControlDesigner.cs