Code:
/ DotNET / DotNET / 8.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
- Group.cs
- CoreChannel.cs
- PrinterUnitConvert.cs
- OptimalBreakSession.cs
- HttpBrowserCapabilitiesWrapper.cs
- SortQuery.cs
- CodeGeneratorAttribute.cs
- DataServiceHostWrapper.cs
- typedescriptorpermission.cs
- XmlCharCheckingWriter.cs
- Membership.cs
- GridToolTip.cs
- RequestCachePolicyConverter.cs
- unsafenativemethodsother.cs
- WindowsEditBox.cs
- DocumentViewerHelper.cs
- SecureConversationSecurityTokenParameters.cs
- Scanner.cs
- EnumConverter.cs
- DataObjectFieldAttribute.cs
- Attributes.cs
- MailMessageEventArgs.cs
- CodeSubDirectoriesCollection.cs
- DataSourceHelper.cs
- DataContext.cs
- EntityClassGenerator.cs
- HttpBindingExtension.cs
- QueryableDataSourceView.cs
- ToolStripPanelRow.cs
- Pkcs9Attribute.cs
- FileInfo.cs
- Line.cs
- StrongNameUtility.cs
- UTF8Encoding.cs
- BinaryKeyIdentifierClause.cs
- ServicesExceptionNotHandledEventArgs.cs
- BinHexEncoder.cs
- BuiltInPermissionSets.cs
- BoundsDrawingContextWalker.cs
- TextBoxAutoCompleteSourceConverter.cs
- MutexSecurity.cs
- XmlSchemaValidator.cs
- FileChangesMonitor.cs
- ObjectSelectorEditor.cs
- SelectorItemAutomationPeer.cs
- AssemblyCollection.cs
- XamlDebuggerXmlReader.cs
- SourceItem.cs
- KeyEvent.cs
- HandledMouseEvent.cs
- ContainerParagraph.cs
- rsa.cs
- QEncodedStream.cs
- ParameterModifier.cs
- PeerCollaboration.cs
- ResourceIDHelper.cs
- SelectedDatesCollection.cs
- UnionQueryOperator.cs
- ContextProperty.cs
- CatalogZone.cs
- GridViewSortEventArgs.cs
- BitmapEffectGroup.cs
- EventSourceCreationData.cs
- QueryAccessibilityHelpEvent.cs
- Substitution.cs
- EdmTypeAttribute.cs
- BuildProvider.cs
- OleAutBinder.cs
- altserialization.cs
- CellIdBoolean.cs
- SqlBuilder.cs
- DesignerGenericWebPart.cs
- Convert.cs
- XPathNodePointer.cs
- UriWriter.cs
- CompilationRelaxations.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- OrthographicCamera.cs
- CodeIndexerExpression.cs
- SqlReferenceCollection.cs
- LinkLabelLinkClickedEvent.cs
- DrawingImage.cs
- ColorAnimationBase.cs
- SamlSecurityToken.cs
- Button.cs
- SystemIPInterfaceStatistics.cs
- ParallelEnumerableWrapper.cs
- ObjectDataSourceEventArgs.cs
- TCPListener.cs
- AssemblyAssociatedContentFileAttribute.cs
- DataGridTextBoxColumn.cs
- SourceFilter.cs
- TextServicesPropertyRanges.cs
- TreeViewEvent.cs
- XmlAnyAttributeAttribute.cs
- TypeInitializationException.cs
- ScriptReferenceEventArgs.cs
- Ref.cs
- AssertUtility.cs
- InheritanceRules.cs