Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / security / system / security / permissions / storepermissionattribute.cs / 1 / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OleDbDataAdapter.cs
- ToolStripItemGlyph.cs
- DesignerSerializationOptionsAttribute.cs
- BitmapEffectGroup.cs
- ManifestResourceInfo.cs
- WindowsTab.cs
- WebFormsRootDesigner.cs
- XhtmlConformanceSection.cs
- PeerName.cs
- UpdatableGenericsFeature.cs
- InputLanguageSource.cs
- TabControlCancelEvent.cs
- DelegatingConfigHost.cs
- Nullable.cs
- CombinedGeometry.cs
- LoginUtil.cs
- InteropAutomationProvider.cs
- ValueTable.cs
- TaskFactory.cs
- XPathBinder.cs
- EntityDataSourceContextCreatedEventArgs.cs
- FileVersion.cs
- PackageFilter.cs
- WebBrowserContainer.cs
- DuplicateWaitObjectException.cs
- MenuBase.cs
- DateTimeUtil.cs
- CacheSection.cs
- SafeFileMappingHandle.cs
- LinkedResourceCollection.cs
- SimpleLine.cs
- SplitContainerDesigner.cs
- DataColumnMappingCollection.cs
- MediaEntryAttribute.cs
- PropertyCollection.cs
- NetworkCredential.cs
- ConfigurationCollectionAttribute.cs
- Validator.cs
- PolyQuadraticBezierSegment.cs
- LongValidator.cs
- DataTemplateSelector.cs
- OdbcRowUpdatingEvent.cs
- MsmqReceiveHelper.cs
- XmlChildNodes.cs
- TraceContextRecord.cs
- Splitter.cs
- WsdlInspector.cs
- ModelPerspective.cs
- AppDomainAttributes.cs
- XmlUTF8TextReader.cs
- IpcClientManager.cs
- CaseInsensitiveHashCodeProvider.cs
- RichTextBox.cs
- TextRunCacheImp.cs
- HtmlContainerControl.cs
- CodeExporter.cs
- TextElementEnumerator.cs
- oledbconnectionstring.cs
- JavaScriptObjectDeserializer.cs
- DbgCompiler.cs
- DBSqlParserColumn.cs
- FeatureSupport.cs
- CardSpaceSelector.cs
- PrincipalPermission.cs
- TextRangeEdit.cs
- AttributeInfo.cs
- TableLayoutPanelCodeDomSerializer.cs
- ColumnResizeUndoUnit.cs
- SeekStoryboard.cs
- __Filters.cs
- ItemCollection.cs
- ListViewCancelEventArgs.cs
- DataGridViewCellStyleChangedEventArgs.cs
- StreamGeometryContext.cs
- WindowsEditBoxRange.cs
- BasicHttpBindingCollectionElement.cs
- Formatter.cs
- KeyedHashAlgorithm.cs
- HtmlMeta.cs
- StringAttributeCollection.cs
- WSDualHttpSecurity.cs
- SqlRowUpdatingEvent.cs
- OAVariantLib.cs
- StylusButtonCollection.cs
- UnmanagedHandle.cs
- RegionData.cs
- FormViewPagerRow.cs
- TypeDelegator.cs
- NamespaceQuery.cs
- LicenseContext.cs
- GradientStopCollection.cs
- MultipartContentParser.cs
- typedescriptorpermission.cs
- SamlSecurityTokenAuthenticator.cs
- ConfigXmlWhitespace.cs
- ErrorWebPart.cs
- HttpModule.cs
- DataSourceProvider.cs
- DbRetry.cs
- AsyncOperationManager.cs