Code:
/ 4.0 / 4.0 / 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. // ==++== // // 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
- TypeNameParser.cs
- BlurEffect.cs
- LinkedResourceCollection.cs
- Debug.cs
- VisualStyleInformation.cs
- InputScope.cs
- DoubleConverter.cs
- WindowProviderWrapper.cs
- WebBrowsableAttribute.cs
- XpsResource.cs
- FocusWithinProperty.cs
- EmptyStringExpandableObjectConverter.cs
- ImageConverter.cs
- CodeActivityContext.cs
- GridSplitter.cs
- Char.cs
- ProtocolsConfiguration.cs
- DomNameTable.cs
- AlphaSortedEnumConverter.cs
- PasswordValidationException.cs
- HttpApplicationFactory.cs
- LineServicesRun.cs
- WebBrowserUriTypeConverter.cs
- SafePointer.cs
- InplaceBitmapMetadataWriter.cs
- BaseConfigurationRecord.cs
- WorkflowMarkupSerializationException.cs
- XhtmlBasicSelectionListAdapter.cs
- AutomationEventArgs.cs
- OleDbStruct.cs
- TextMarkerSource.cs
- Int32KeyFrameCollection.cs
- TypeBinaryExpression.cs
- ToolTip.cs
- DiscreteKeyFrames.cs
- TraceContextRecord.cs
- FieldMetadata.cs
- SrgsToken.cs
- VisualBrush.cs
- VectorAnimationUsingKeyFrames.cs
- FamilyCollection.cs
- DefaultTypeArgumentAttribute.cs
- CssTextWriter.cs
- ScrollItemPatternIdentifiers.cs
- WebColorConverter.cs
- PointHitTestParameters.cs
- FontCacheLogic.cs
- DuplicateMessageDetector.cs
- ManagementEventArgs.cs
- CustomAttributeSerializer.cs
- _LoggingObject.cs
- RowParagraph.cs
- ReachDocumentSequenceSerializerAsync.cs
- CalendarDay.cs
- GeometryModel3D.cs
- OpenTypeLayoutCache.cs
- CheckBoxRenderer.cs
- VisualStyleInformation.cs
- StyleSheetDesigner.cs
- TextEditorTyping.cs
- CqlQuery.cs
- QueryCursorEventArgs.cs
- RelativeSource.cs
- Helpers.cs
- IISUnsafeMethods.cs
- CompilerGeneratedAttribute.cs
- ObjectStateManager.cs
- CodeAttributeArgumentCollection.cs
- QilValidationVisitor.cs
- ColorMap.cs
- ComboBoxRenderer.cs
- Math.cs
- SQLBoolean.cs
- TcpClientSocketManager.cs
- BitmapCacheBrush.cs
- ZipFileInfo.cs
- TransactionFlowBindingElement.cs
- AppDomainCompilerProxy.cs
- ColorTranslator.cs
- CfgArc.cs
- CachingHintValidation.cs
- WSDualHttpSecurityElement.cs
- XmlChildEnumerator.cs
- BaseInfoTable.cs
- securitymgrsite.cs
- ButtonChrome.cs
- Messages.cs
- FrameworkTemplate.cs
- QueryCreatedEventArgs.cs
- Point.cs
- MSAANativeProvider.cs
- TextCompositionManager.cs
- TrackingQueryElement.cs
- TemplateBindingExtension.cs
- DataGridTablesFactory.cs
- Size3D.cs
- MsmqIntegrationOutputChannel.cs
- EntityDataSourceDataSelectionPanel.designer.cs
- WorkflowMessageEventArgs.cs
- ActivationArguments.cs