Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / ManagedLibraries / Security / System / Security / permissions / dataprotectionpermissionattribute.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TextContainerChangeEventArgs.cs
- XmlSchemaSimpleContentExtension.cs
- MouseDevice.cs
- loginstatus.cs
- MDIClient.cs
- M3DUtil.cs
- XmlUrlResolver.cs
- RuntimeHandles.cs
- AbstractSvcMapFileLoader.cs
- SmtpNegotiateAuthenticationModule.cs
- TableCellCollection.cs
- SessionEndingEventArgs.cs
- SafeCertificateStore.cs
- PersonalizationStateQuery.cs
- TypeUtil.cs
- SimpleParser.cs
- CancelRequestedRecord.cs
- InternalUserCancelledException.cs
- OleDbStruct.cs
- PriorityQueue.cs
- UriTemplateQueryValue.cs
- SmtpCommands.cs
- DataTemplate.cs
- GeometryCombineModeValidation.cs
- ActivityDesignerResources.cs
- WindowsRegion.cs
- Int64Storage.cs
- Identity.cs
- FirstMatchCodeGroup.cs
- DocumentManager.cs
- AuthenticateEventArgs.cs
- GeometryValueSerializer.cs
- WebHeaderCollection.cs
- BindableAttribute.cs
- RequestBringIntoViewEventArgs.cs
- GroupBoxAutomationPeer.cs
- SafeTimerHandle.cs
- BinaryMessageFormatter.cs
- RecordManager.cs
- EntityException.cs
- TemplateGroupCollection.cs
- BamlVersionHeader.cs
- DynamicObject.cs
- ListViewItemSelectionChangedEvent.cs
- FlowLayoutSettings.cs
- FormViewCommandEventArgs.cs
- ModuleElement.cs
- ConfigXmlDocument.cs
- BackEase.cs
- CriticalExceptions.cs
- SHA256.cs
- EqualityComparer.cs
- EventHandlersStore.cs
- CalendarModeChangedEventArgs.cs
- HttpProfileGroupBase.cs
- sapiproxy.cs
- Cursor.cs
- Message.cs
- RequiredFieldValidator.cs
- ApplicationException.cs
- StringUtil.cs
- ContentElement.cs
- EntityException.cs
- ObjectViewListener.cs
- DataAdapter.cs
- ScrollPattern.cs
- XmlCountingReader.cs
- WebPartConnectionsConfigureVerb.cs
- OdbcConnection.cs
- RequestCachePolicy.cs
- DataTablePropertyDescriptor.cs
- StorageAssociationTypeMapping.cs
- DBCommand.cs
- HashSetEqualityComparer.cs
- HttpProfileBase.cs
- ProviderSettingsCollection.cs
- AutomationPatternInfo.cs
- LocatorGroup.cs
- ServiceOperationListItemList.cs
- XmlConverter.cs
- ApplicationFileCodeDomTreeGenerator.cs
- WebEvents.cs
- TemplatePartAttribute.cs
- Win32MouseDevice.cs
- EntryPointNotFoundException.cs
- WhitespaceRuleReader.cs
- WebPartDeleteVerb.cs
- RawAppCommandInputReport.cs
- RegexCompilationInfo.cs
- HitTestParameters3D.cs
- ReliabilityContractAttribute.cs
- UserPersonalizationStateInfo.cs
- GlobalId.cs
- DataKey.cs
- DataListCommandEventArgs.cs
- SoapSchemaMember.cs
- CompositeActivityCodeGenerator.cs
- DependencyPropertyConverter.cs
- Globals.cs
- PointConverter.cs