Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // 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
- AssociatedControlConverter.cs
- ThumbAutomationPeer.cs
- basecomparevalidator.cs
- ComplusEndpointConfigContainer.cs
- thaishape.cs
- WindowsAuthenticationModule.cs
- XamlTreeBuilder.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- RawKeyboardInputReport.cs
- ProtectedConfiguration.cs
- ToolStripArrowRenderEventArgs.cs
- DateTimeOffsetStorage.cs
- SettingsPropertyNotFoundException.cs
- OleDbCommand.cs
- ParameterInfo.cs
- XamlReader.cs
- ListBox.cs
- WorkflowTerminatedException.cs
- EntitySetDataBindingList.cs
- JoinElimination.cs
- Condition.cs
- OverflowException.cs
- Int32Storage.cs
- PseudoWebRequest.cs
- Compress.cs
- SafeNativeMemoryHandle.cs
- CodeTypeOfExpression.cs
- DataControlFieldCollection.cs
- DataSourceXmlElementAttribute.cs
- XmlSchemaAttributeGroup.cs
- InfiniteIntConverter.cs
- TrustExchangeException.cs
- MetadataExchangeClient.cs
- ScriptingJsonSerializationSection.cs
- ScaleTransform.cs
- DataRecord.cs
- ExpressionBindingCollection.cs
- X500Name.cs
- SQLMembershipProvider.cs
- LinqToSqlWrapper.cs
- XmlAttributeCache.cs
- EmptyWithCancelationCheckWorkItem.cs
- WindowProviderWrapper.cs
- Stylesheet.cs
- ItemCollectionEditor.cs
- ToolStripSeparatorRenderEventArgs.cs
- DataListAutoFormat.cs
- ConfigurationManagerInternal.cs
- TdsValueSetter.cs
- EnumValAlphaComparer.cs
- EventMetadata.cs
- PointLight.cs
- OleDbMetaDataFactory.cs
- HandledMouseEvent.cs
- User.cs
- GACIdentityPermission.cs
- WebExceptionStatus.cs
- storagemappingitemcollection.viewdictionary.cs
- storagemappingitemcollection.viewdictionary.cs
- PagerSettings.cs
- DataGridViewLinkColumn.cs
- ExtendedPropertyCollection.cs
- SqlTriggerContext.cs
- ProfilePropertyNameValidator.cs
- MouseEvent.cs
- DistributedTransactionPermission.cs
- SHA1Managed.cs
- HtmlFormAdapter.cs
- XomlCompilerParameters.cs
- DataSetMappper.cs
- SqlServices.cs
- SignedPkcs7.cs
- KeyManager.cs
- RelationshipConverter.cs
- CursorInteropHelper.cs
- ContentElement.cs
- MobileUserControlDesigner.cs
- Visitors.cs
- LineVisual.cs
- CompositeDataBoundControl.cs
- CalendarDataBindingHandler.cs
- DecoderExceptionFallback.cs
- XamlToRtfParser.cs
- GradientStop.cs
- InputProcessorProfiles.cs
- CardSpacePolicyElement.cs
- UserMapPath.cs
- SmtpReplyReader.cs
- DateTimePicker.cs
- ObjectStorage.cs
- PackagingUtilities.cs
- RankException.cs
- PasswordBox.cs
- LinqMaximalSubtreeNominator.cs
- SQLSingle.cs
- BaseCollection.cs
- SaveFileDialog.cs
- GeneralTransform3DCollection.cs
- FixedTextBuilder.cs
- XmlChildEnumerator.cs