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
- ViewLoader.cs
- OLEDB_Util.cs
- MessagingActivityHelper.cs
- StorageFunctionMapping.cs
- ThemeConfigurationDialog.cs
- TextPenaltyModule.cs
- TableLayoutPanelCellPosition.cs
- Gdiplus.cs
- DrawingGroup.cs
- WeakReference.cs
- RegexReplacement.cs
- TabControl.cs
- EventTask.cs
- FocusWithinProperty.cs
- ZipIOModeEnforcingStream.cs
- ObjectSecurityT.cs
- MouseButtonEventArgs.cs
- FieldValue.cs
- ParseHttpDate.cs
- FilteredXmlReader.cs
- ScriptReference.cs
- ReadOnlyPropertyMetadata.cs
- QueryProcessor.cs
- PropertyAccessVisitor.cs
- LinkDescriptor.cs
- CacheModeValueSerializer.cs
- InlineObject.cs
- PropertyOverridesDialog.cs
- CustomMenuItemCollection.cs
- PropertySegmentSerializationProvider.cs
- TableHeaderCell.cs
- StringReader.cs
- AspNetSynchronizationContext.cs
- DynamicRendererThreadManager.cs
- InputLanguage.cs
- RoleService.cs
- ContextStaticAttribute.cs
- FileSystemWatcher.cs
- BindingEntityInfo.cs
- AssemblySettingAttributes.cs
- TargetInvocationException.cs
- HitTestWithPointDrawingContextWalker.cs
- VBCodeProvider.cs
- SqlGenerator.cs
- DoubleStorage.cs
- Attributes.cs
- ToolStripMenuItem.cs
- Vector3DIndependentAnimationStorage.cs
- RemotingException.cs
- PathData.cs
- DesignerActionGlyph.cs
- SafeRegistryHandle.cs
- TextWriterTraceListener.cs
- FlowDocumentPage.cs
- UIntPtr.cs
- TraceContextEventArgs.cs
- WebServiceMethodData.cs
- PagerStyle.cs
- DrawingBrush.cs
- UnionCodeGroup.cs
- TableRowGroup.cs
- TableCellCollection.cs
- SchemaImporter.cs
- FlowDocumentPaginator.cs
- ManualResetEvent.cs
- Listbox.cs
- Point4DConverter.cs
- TextEncodedRawTextWriter.cs
- ToolBar.cs
- DbMetaDataColumnNames.cs
- TypePresenter.xaml.cs
- TableRow.cs
- FilteredXmlReader.cs
- QueryReaderSettings.cs
- ISFTagAndGuidCache.cs
- ActivityScheduledQuery.cs
- Win32SafeHandles.cs
- MaterializeFromAtom.cs
- PasswordDeriveBytes.cs
- SqlParameter.cs
- TextElementEnumerator.cs
- HtmlTextArea.cs
- ImageList.cs
- PersianCalendar.cs
- ViewGenerator.cs
- JsonObjectDataContract.cs
- CacheDependency.cs
- ShapingWorkspace.cs
- InputReportEventArgs.cs
- FunctionMappingTranslator.cs
- ByteArrayHelperWithString.cs
- XPathNavigator.cs
- NullableDecimalMinMaxAggregationOperator.cs
- DBSqlParserTable.cs
- WebPartTransformerAttribute.cs
- ValidationErrorEventArgs.cs
- ResourceReferenceExpression.cs
- KeyValueSerializer.cs
- HttpInputStream.cs
- InheritablePropertyChangeInfo.cs