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
- EditorPartCollection.cs
- CodeBinaryOperatorExpression.cs
- ResourcesChangeInfo.cs
- DescendantOverDescendantQuery.cs
- WindowsRegion.cs
- HideDisabledControlAdapter.cs
- PixelShader.cs
- DataControlExtensions.cs
- ModelFactory.cs
- ExpressionConverter.cs
- Lasso.cs
- DrawListViewSubItemEventArgs.cs
- DataFormat.cs
- Pointer.cs
- ControlOperationBehavior.cs
- ProgressPage.cs
- safemediahandle.cs
- OneWayElement.cs
- prompt.cs
- CreateUserWizard.cs
- RoleManagerEventArgs.cs
- TypeNameConverter.cs
- CompareValidator.cs
- FileDialogCustomPlace.cs
- InternalSafeNativeMethods.cs
- BamlVersionHeader.cs
- ScopelessEnumAttribute.cs
- ScrollItemProviderWrapper.cs
- DataGridViewCellStateChangedEventArgs.cs
- Attribute.cs
- EmptyCollection.cs
- AnimationLayer.cs
- XmlMapping.cs
- FixedPageProcessor.cs
- GuidelineCollection.cs
- HwndAppCommandInputProvider.cs
- GregorianCalendar.cs
- Utils.cs
- BuildManagerHost.cs
- DeclaredTypeValidator.cs
- XmlHierarchicalEnumerable.cs
- Pens.cs
- HttpResponseBase.cs
- ISFTagAndGuidCache.cs
- PickBranchDesigner.xaml.cs
- ExcludeFromCodeCoverageAttribute.cs
- SamlAttributeStatement.cs
- HttpProfileBase.cs
- FixedPageProcessor.cs
- SQLDateTimeStorage.cs
- QilChoice.cs
- TextEditorParagraphs.cs
- CodeArgumentReferenceExpression.cs
- HttpModuleAction.cs
- TableRowCollection.cs
- BinaryQueryOperator.cs
- ClientFormsAuthenticationCredentials.cs
- HttpDebugHandler.cs
- GridViewDeleteEventArgs.cs
- TextPenaltyModule.cs
- AssociationEndMember.cs
- SqlWriter.cs
- NumericUpDownAccelerationCollection.cs
- GlyphRunDrawing.cs
- ListBindingConverter.cs
- Image.cs
- BitmapData.cs
- WindowsFont.cs
- ElementsClipboardData.cs
- BuildManagerHost.cs
- AttributeQuery.cs
- DateTime.cs
- ProjectionPathSegment.cs
- ButtonColumn.cs
- SoapHeader.cs
- ConnectionManagementSection.cs
- CurrentTimeZone.cs
- CommandID.cs
- SafeProcessHandle.cs
- OrderedDictionary.cs
- HyperLinkField.cs
- PreviewPrintController.cs
- DetailsViewActionList.cs
- CodeStatement.cs
- NetworkCredential.cs
- PointLight.cs
- WindowsRichEditRange.cs
- CorrelationManager.cs
- AssemblyHash.cs
- StrongNamePublicKeyBlob.cs
- ColumnWidthChangingEvent.cs
- XmlSchemaValidator.cs
- ObjectContextServiceProvider.cs
- SQLByte.cs
- ContentHostHelper.cs
- NetworkStream.cs
- ReflectionUtil.cs
- RSAPKCS1SignatureFormatter.cs
- XsltException.cs
- UrlUtility.cs