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
- VariableModifiersHelper.cs
- EntityDataSourceEntitySetNameItem.cs
- HiddenFieldPageStatePersister.cs
- BitFlagsGenerator.cs
- Unit.cs
- AsyncCompletedEventArgs.cs
- ToolStripSplitStackLayout.cs
- InProcStateClientManager.cs
- DesignerRegionCollection.cs
- contentDescriptor.cs
- CachedBitmap.cs
- ObjectSpanRewriter.cs
- RemotingException.cs
- ContextStaticAttribute.cs
- CheckBoxField.cs
- Comparer.cs
- QilValidationVisitor.cs
- XPathMultyIterator.cs
- CircleHotSpot.cs
- TwoPhaseCommit.cs
- EditorServiceContext.cs
- CodeCommentStatementCollection.cs
- TypefaceMap.cs
- FactorySettingsElement.cs
- ZoneMembershipCondition.cs
- AllMembershipCondition.cs
- ScaleTransform.cs
- ResXResourceWriter.cs
- DeadCharTextComposition.cs
- CacheAxisQuery.cs
- Dispatcher.cs
- Vector3DAnimation.cs
- GridViewDeletedEventArgs.cs
- SourceFileInfo.cs
- contentDescriptor.cs
- XmlQueryContext.cs
- QilVisitor.cs
- BitArray.cs
- ToolboxDataAttribute.cs
- DispatcherSynchronizationContext.cs
- WebPartZoneBaseDesigner.cs
- WpfXamlLoader.cs
- ConfigsHelper.cs
- TemplateXamlTreeBuilder.cs
- TimeSpanMinutesConverter.cs
- ServicesExceptionNotHandledEventArgs.cs
- MouseEventArgs.cs
- GlyphRunDrawing.cs
- AdapterDictionary.cs
- ModelVisual3D.cs
- SafeUserTokenHandle.cs
- _KerberosClient.cs
- InputDevice.cs
- PageContentAsyncResult.cs
- RunInstallerAttribute.cs
- SqlFacetAttribute.cs
- TypeBuilderInstantiation.cs
- CodeDomLocalizationProvider.cs
- EntityDescriptor.cs
- AlphaSortedEnumConverter.cs
- ControllableStoryboardAction.cs
- DelegateBodyWriter.cs
- ZipIOExtraFieldZip64Element.cs
- NonPrimarySelectionGlyph.cs
- TableSectionStyle.cs
- SizeF.cs
- IgnorePropertiesAttribute.cs
- SessionStateModule.cs
- SqlCommand.cs
- MonikerProxyAttribute.cs
- SimpleBitVector32.cs
- RegexWriter.cs
- XsltException.cs
- HwndSourceKeyboardInputSite.cs
- UInt16.cs
- SafeMarshalContext.cs
- UInt16Storage.cs
- WaitForChangedResult.cs
- ByteFacetDescriptionElement.cs
- UInt16Storage.cs
- TreeViewTemplateSelector.cs
- SimpleWorkerRequest.cs
- QuaternionIndependentAnimationStorage.cs
- OutputCacheModule.cs
- ExpressionBindingCollection.cs
- ActivityExecutionFilter.cs
- GenericXmlSecurityToken.cs
- PictureBox.cs
- DataGridViewRowsAddedEventArgs.cs
- DbParameterCollectionHelper.cs
- ClickablePoint.cs
- SmiMetaData.cs
- SqlNotificationEventArgs.cs
- MultipartIdentifier.cs
- PinnedBufferMemoryStream.cs
- EntityKeyElement.cs
- QilUnary.cs
- AmbiguousMatchException.cs
- UriSection.cs
- FileReservationCollection.cs