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
- SimpleWebHandlerParser.cs
- HtmlHead.cs
- TriggerBase.cs
- MimeMultiPart.cs
- ExpressionBuilder.cs
- EventLogger.cs
- DataGridRowDetailsEventArgs.cs
- GridViewDeleteEventArgs.cs
- BoundField.cs
- ByteStreamMessageUtility.cs
- HwndSource.cs
- DiscoveryClientReferences.cs
- Keywords.cs
- TransformerConfigurationWizardBase.cs
- SignedPkcs7.cs
- FacetEnabledSchemaElement.cs
- PropertyValueChangedEvent.cs
- DataGrid.cs
- Graphics.cs
- DataContractJsonSerializer.cs
- latinshape.cs
- TreeNodeStyle.cs
- SqlConnectionString.cs
- XmlAttributeCache.cs
- HyperlinkAutomationPeer.cs
- XamlReader.cs
- MenuItemCollection.cs
- TypeHelpers.cs
- PathGradientBrush.cs
- SystemIPv4InterfaceProperties.cs
- ElementHostAutomationPeer.cs
- ContractHandle.cs
- SQLInt16Storage.cs
- DataGridViewLayoutData.cs
- RegisteredHiddenField.cs
- DataTable.cs
- TemplateBindingExpression.cs
- OleDbPermission.cs
- EffectiveValueEntry.cs
- PersonalizationState.cs
- AnimationClockResource.cs
- httpserverutility.cs
- DesignerOptionService.cs
- XmlDocumentType.cs
- KeyValuePair.cs
- ExtensionSimplifierMarkupObject.cs
- DllNotFoundException.cs
- WorkflowEnvironment.cs
- WindowsPen.cs
- RuleSettingsCollection.cs
- BufferedWebEventProvider.cs
- TrustLevel.cs
- ByteRangeDownloader.cs
- TrackBar.cs
- FormatConvertedBitmap.cs
- KeyConverter.cs
- DropShadowEffect.cs
- DynamicArgumentDialog.cs
- Profiler.cs
- TextEndOfLine.cs
- ObjectDataSourceMethodEditor.cs
- CellPartitioner.cs
- FunctionQuery.cs
- MemberJoinTreeNode.cs
- ProtocolViolationException.cs
- DataServiceQueryProvider.cs
- Library.cs
- DynamicField.cs
- XmlSchemaInclude.cs
- DefaultTextStore.cs
- ScriptingScriptResourceHandlerSection.cs
- DataServices.cs
- CompilationUnit.cs
- CodeTypeMemberCollection.cs
- PermissionSetTriple.cs
- DBCommandBuilder.cs
- GridItemPattern.cs
- InheritanceContextHelper.cs
- SimpleFieldTemplateFactory.cs
- PartialCachingAttribute.cs
- LongMinMaxAggregationOperator.cs
- KeyNotFoundException.cs
- Control.cs
- AutoGeneratedField.cs
- PresentationSource.cs
- UnsafeNativeMethodsPenimc.cs
- RawStylusInputCustomDataList.cs
- TextParagraphView.cs
- TaiwanLunisolarCalendar.cs
- XmlSchemaCompilationSettings.cs
- PerformanceCounter.cs
- CatalogZone.cs
- XmlStreamedByteStreamReader.cs
- PreservationFileReader.cs
- DBCommandBuilder.cs
- DynamicMethod.cs
- TemplatePropertyEntry.cs
- Formatter.cs
- DataGridViewRowPrePaintEventArgs.cs
- TextElementEnumerator.cs