Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / clr / src / ManagedLibraries / Security / System / Security / permissions / dataprotectionpermissionattribute.cs / 5 / dataprotectionpermissionattribute.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // DataProtectionPermission.cs // namespace System.Security.Permissions { [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )] [Serializable()] [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class DataProtectionPermissionAttribute : CodeAccessSecurityAttribute { private DataProtectionPermissionFlags m_flags = DataProtectionPermissionFlags.NoFlags; public DataProtectionPermissionAttribute (SecurityAction action) : base (action) {} public DataProtectionPermissionFlags Flags { get { return m_flags; } set { DataProtectionPermission.VerifyFlags(value); m_flags = value; } } public bool ProtectData { get { return (m_flags & DataProtectionPermissionFlags.ProtectData) != 0; } set { m_flags = value ? m_flags | DataProtectionPermissionFlags.ProtectData : m_flags & ~DataProtectionPermissionFlags.ProtectData; } } public bool UnprotectData { get { return (m_flags & DataProtectionPermissionFlags.UnprotectData) != 0; } set { m_flags = value ? m_flags | DataProtectionPermissionFlags.UnprotectData : m_flags & ~DataProtectionPermissionFlags.UnprotectData; } } public bool ProtectMemory { get { return (m_flags & DataProtectionPermissionFlags.ProtectMemory) != 0; } set { m_flags = value ? m_flags | DataProtectionPermissionFlags.ProtectMemory : m_flags & ~DataProtectionPermissionFlags.ProtectMemory; } } public bool UnprotectMemory { get { return (m_flags & DataProtectionPermissionFlags.UnprotectMemory) != 0; } set { m_flags = value ? m_flags | DataProtectionPermissionFlags.UnprotectMemory : m_flags & ~DataProtectionPermissionFlags.UnprotectMemory; } } public override IPermission CreatePermission () { if (Unrestricted) return new DataProtectionPermission(PermissionState.Unrestricted); else return new DataProtectionPermission(m_flags); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // DataProtectionPermission.cs // namespace System.Security.Permissions { [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )] [Serializable()] [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class DataProtectionPermissionAttribute : CodeAccessSecurityAttribute { private DataProtectionPermissionFlags m_flags = DataProtectionPermissionFlags.NoFlags; public DataProtectionPermissionAttribute (SecurityAction action) : base (action) {} public DataProtectionPermissionFlags Flags { get { return m_flags; } set { DataProtectionPermission.VerifyFlags(value); m_flags = value; } } public bool ProtectData { get { return (m_flags & DataProtectionPermissionFlags.ProtectData) != 0; } set { m_flags = value ? m_flags | DataProtectionPermissionFlags.ProtectData : m_flags & ~DataProtectionPermissionFlags.ProtectData; } } public bool UnprotectData { get { return (m_flags & DataProtectionPermissionFlags.UnprotectData) != 0; } set { m_flags = value ? m_flags | DataProtectionPermissionFlags.UnprotectData : m_flags & ~DataProtectionPermissionFlags.UnprotectData; } } public bool ProtectMemory { get { return (m_flags & DataProtectionPermissionFlags.ProtectMemory) != 0; } set { m_flags = value ? m_flags | DataProtectionPermissionFlags.ProtectMemory : m_flags & ~DataProtectionPermissionFlags.ProtectMemory; } } public bool UnprotectMemory { get { return (m_flags & DataProtectionPermissionFlags.UnprotectMemory) != 0; } set { m_flags = value ? m_flags | DataProtectionPermissionFlags.UnprotectMemory : m_flags & ~DataProtectionPermissionFlags.UnprotectMemory; } } public override IPermission CreatePermission () { if (Unrestricted) return new DataProtectionPermission(PermissionState.Unrestricted); else return new DataProtectionPermission(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
- FormatControl.cs
- Line.cs
- ContextDataSourceContextData.cs
- DataObjectSettingDataEventArgs.cs
- MinimizableAttributeTypeConverter.cs
- WebPartChrome.cs
- ScrollProviderWrapper.cs
- SqlXml.cs
- OledbConnectionStringbuilder.cs
- DataGridViewEditingControlShowingEventArgs.cs
- COM2ExtendedBrowsingHandler.cs
- SelectionItemPattern.cs
- ViewgenGatekeeper.cs
- mil_commands.cs
- BinaryCommonClasses.cs
- SqlConnectionPoolGroupProviderInfo.cs
- HelpKeywordAttribute.cs
- TypeDelegator.cs
- HwndHost.cs
- UnknownWrapper.cs
- SoapSchemaMember.cs
- CornerRadius.cs
- ExcludeFromCodeCoverageAttribute.cs
- TextSimpleMarkerProperties.cs
- BrowserCapabilitiesFactory35.cs
- Slider.cs
- BypassElement.cs
- TreeViewHitTestInfo.cs
- coordinator.cs
- CompensationHandlingFilter.cs
- ScopelessEnumAttribute.cs
- WebPartEditVerb.cs
- CompModSwitches.cs
- RenderOptions.cs
- AnimationException.cs
- XXXInfos.cs
- NegotiateStream.cs
- GestureRecognitionResult.cs
- WebBrowserNavigatedEventHandler.cs
- TcpClientChannel.cs
- OledbConnectionStringbuilder.cs
- ControlValuePropertyAttribute.cs
- PropertyReferenceExtension.cs
- OutKeywords.cs
- MailBnfHelper.cs
- PiiTraceSource.cs
- Function.cs
- SimpleBitVector32.cs
- TTSEvent.cs
- CompModSwitches.cs
- ErrorHandler.cs
- AssociationEndMember.cs
- PageTheme.cs
- ModifiableIteratorCollection.cs
- MatrixTransform3D.cs
- _RequestLifetimeSetter.cs
- FixedSOMTableRow.cs
- IPPacketInformation.cs
- CustomErrorsSectionWrapper.cs
- PageContentCollection.cs
- ListView.cs
- ModelTypeConverter.cs
- DesignColumn.cs
- PropertyTabChangedEvent.cs
- DataGridCellAutomationPeer.cs
- HttpResponseWrapper.cs
- DataGridViewElement.cs
- HwndProxyElementProvider.cs
- UnsafeNativeMethods.cs
- BulletedList.cs
- FontUnit.cs
- InteropExecutor.cs
- ListDictionaryInternal.cs
- CodeLabeledStatement.cs
- ResponseBodyWriter.cs
- GPRECTF.cs
- ServiceProviders.cs
- XPathItem.cs
- FieldToken.cs
- RegexBoyerMoore.cs
- CalendarData.cs
- HttpWebRequest.cs
- HostedController.cs
- SiteOfOriginContainer.cs
- SynchronizedInputAdaptor.cs
- mediaeventargs.cs
- MaxSessionCountExceededException.cs
- TableRow.cs
- MethodBuilder.cs
- PageCache.cs
- SimpleType.cs
- SemanticKeyElement.cs
- EventMappingSettingsCollection.cs
- MultiView.cs
- ButtonFlatAdapter.cs
- CollectionViewGroup.cs
- IntranetCredentialPolicy.cs
- LineBreakRecord.cs
- MenuCommand.cs
- SqlVersion.cs