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
- UnsafeNativeMethodsMilCoreApi.cs
- BackStopAuthenticationModule.cs
- InputBindingCollection.cs
- PTConverter.cs
- PersistenceContextEnlistment.cs
- MessageQueueEnumerator.cs
- Pen.cs
- ResolveNameEventArgs.cs
- _ListenerRequestStream.cs
- PaperSource.cs
- EntityDataSourceUtil.cs
- ObjectViewEntityCollectionData.cs
- CellQuery.cs
- WebServiceMethodData.cs
- SecurityTokenException.cs
- SectionUpdates.cs
- XmlILConstructAnalyzer.cs
- ConfigurationValidatorBase.cs
- ReadOnlyHierarchicalDataSourceView.cs
- MetabaseSettingsIis7.cs
- TextAutomationPeer.cs
- EmptyEnumerator.cs
- AddInIpcChannel.cs
- FileController.cs
- WorkItem.cs
- WebPartConnection.cs
- OracleParameter.cs
- ConfigurationManagerHelper.cs
- XmlLanguageConverter.cs
- ComponentChangedEvent.cs
- ComEventsHelper.cs
- MultiSelectRootGridEntry.cs
- FixedPageStructure.cs
- VariantWrapper.cs
- ToolStripMenuItem.cs
- BinaryEditor.cs
- TileBrush.cs
- EnumerableRowCollection.cs
- SchemaMapping.cs
- ProviderConnectionPointCollection.cs
- DesignerExtenders.cs
- DesignerCommandSet.cs
- CompilerResults.cs
- ReadOnlyHierarchicalDataSource.cs
- TextEditorTables.cs
- IODescriptionAttribute.cs
- StyleModeStack.cs
- FontWeightConverter.cs
- Rfc2898DeriveBytes.cs
- ModuleElement.cs
- PassportAuthenticationEventArgs.cs
- TypeConverterMarkupExtension.cs
- ArcSegment.cs
- StringResourceManager.cs
- ToolboxItemAttribute.cs
- DWriteFactory.cs
- SHA384CryptoServiceProvider.cs
- SettingsPropertyWrongTypeException.cs
- ValidationSummary.cs
- mil_sdk_version.cs
- oledbconnectionstring.cs
- NativeMethods.cs
- TreeViewImageGenerator.cs
- ClientRolePrincipal.cs
- WebPartConnectionsCloseVerb.cs
- SingleTagSectionHandler.cs
- StandardBindingElementCollection.cs
- NamedPermissionSet.cs
- HighlightComponent.cs
- ProcessModuleCollection.cs
- Context.cs
- MetadataCache.cs
- HttpResponse.cs
- ScrollPattern.cs
- TaskFactory.cs
- Blend.cs
- ElementsClipboardData.cs
- grammarelement.cs
- ZoneLinkButton.cs
- httpserverutility.cs
- ConfigurationPropertyCollection.cs
- Line.cs
- SQLBytes.cs
- DocumentViewerConstants.cs
- bidPrivateBase.cs
- AtomicFile.cs
- HuffCodec.cs
- LogManagementAsyncResult.cs
- HttpCacheVary.cs
- ToolStripItemCollection.cs
- ProfileGroupSettings.cs
- ServerIdentity.cs
- WebServiceFaultDesigner.cs
- SAPICategories.cs
- ErrorWebPart.cs
- PropertyGridEditorPart.cs
- RouteItem.cs
- SuppressIldasmAttribute.cs
- DependencyPropertyChangedEventArgs.cs
- FontSizeConverter.cs