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
- ListItemViewControl.cs
- Pair.cs
- XhtmlConformanceSection.cs
- Imaging.cs
- BrowserCapabilitiesFactory.cs
- safemediahandle.cs
- ParseNumbers.cs
- DataGridViewRowPrePaintEventArgs.cs
- DataSpaceManager.cs
- PageThemeParser.cs
- TdsParserHelperClasses.cs
- DBSqlParserTableCollection.cs
- ResourceKey.cs
- ExtendLockCommand.cs
- ClientProxyGenerator.cs
- FormsAuthenticationConfiguration.cs
- Pen.cs
- SecurityUniqueId.cs
- SplitContainer.cs
- ErrorProvider.cs
- KeySpline.cs
- SafeRegistryKey.cs
- WmlLabelAdapter.cs
- SHA1CryptoServiceProvider.cs
- InheritanceContextHelper.cs
- DataControlFieldCollection.cs
- ObjectQueryExecutionPlan.cs
- GridPatternIdentifiers.cs
- HostProtectionPermission.cs
- ObjectStateEntry.cs
- AnnotationComponentManager.cs
- RequestResizeEvent.cs
- CurrentChangedEventManager.cs
- RestClientProxyHandler.cs
- ReceiveErrorHandling.cs
- SymbolDocumentInfo.cs
- IIS7WorkerRequest.cs
- MethodBody.cs
- XmlBufferReader.cs
- WindowsTokenRoleProvider.cs
- InstanceDataCollection.cs
- DataGridViewCellEventArgs.cs
- XmlNotation.cs
- HatchBrush.cs
- SystemIPInterfaceProperties.cs
- CodeNamespaceImportCollection.cs
- SqlCommandSet.cs
- BreakRecordTable.cs
- TreeViewHitTestInfo.cs
- TreeView.cs
- SamlAction.cs
- XmlNode.cs
- TraceEventCache.cs
- ComplexTypeEmitter.cs
- SqlXmlStorage.cs
- WebPartConnectionsConnectVerb.cs
- CellTreeSimplifier.cs
- TaskExceptionHolder.cs
- Events.cs
- FactoryGenerator.cs
- SctClaimDictionary.cs
- DesignerActionPropertyItem.cs
- MasterPageBuildProvider.cs
- Section.cs
- UIElementHelper.cs
- VScrollProperties.cs
- CalendarModeChangedEventArgs.cs
- VBIdentifierDesigner.xaml.cs
- unsafeIndexingFilterStream.cs
- InitializerFacet.cs
- DbConnectionStringCommon.cs
- TypeUtil.cs
- SqlMethodAttribute.cs
- ManagementPath.cs
- RadioButton.cs
- DrawingAttributes.cs
- DataChangedEventManager.cs
- ipaddressinformationcollection.cs
- Parser.cs
- RemotingAttributes.cs
- ViewPort3D.cs
- DataSourceControlBuilder.cs
- MouseButtonEventArgs.cs
- XmlSchemaCollection.cs
- MarshalByRefObject.cs
- DetailsViewDeletedEventArgs.cs
- IRCollection.cs
- SiteMembershipCondition.cs
- WebPartDescriptionCollection.cs
- AccessDataSourceView.cs
- TextShapeableCharacters.cs
- SessionStateModule.cs
- HttpInputStream.cs
- TypeLoadException.cs
- TabControlToolboxItem.cs
- AppLevelCompilationSectionCache.cs
- HMACSHA384.cs
- DataGridColumn.cs
- GroupItem.cs
- SqlDataSourceRefreshSchemaForm.cs