Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / CommonUI / System / Drawing / Printing / PrintingPermissionAttribute.cs / 1 / PrintingPermissionAttribute.cs
/* * Copyright (c) 2000 Microsoft Corporation. All Rights Reserved. * Microsoft Confidential. */ namespace System.Drawing.Printing { using System; using System.Security; using System.Security.Permissions; using System.IO; using System.Runtime.Serialization; using System.Reflection; using System.Collections; using System.Diagnostics.CodeAnalysis; ///[AttributeUsage(AttributeTargets.All, AllowMultiple = true)] public sealed class PrintingPermissionAttribute : CodeAccessSecurityAttribute { PrintingPermissionLevel level; /// public PrintingPermissionAttribute(SecurityAction action) : base(action) { } /// public PrintingPermissionLevel Level { get { return level; } set { if (value < PrintingPermissionLevel.NoPrinting || value > PrintingPermissionLevel.AllPrinting) { throw new ArgumentException(SR.GetString(SR.PrintingPermissionAttributeInvalidPermissionLevel), "value"); } level = value; } } /// [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity")] public override IPermission CreatePermission() { if (Unrestricted) { return new PrintingPermission(PermissionState.Unrestricted); } else { return new PrintingPermission(level); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. /* * Copyright (c) 2000 Microsoft Corporation. All Rights Reserved. * Microsoft Confidential. */ namespace System.Drawing.Printing { using System; using System.Security; using System.Security.Permissions; using System.IO; using System.Runtime.Serialization; using System.Reflection; using System.Collections; using System.Diagnostics.CodeAnalysis; /// [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] public sealed class PrintingPermissionAttribute : CodeAccessSecurityAttribute { PrintingPermissionLevel level; /// public PrintingPermissionAttribute(SecurityAction action) : base(action) { } /// public PrintingPermissionLevel Level { get { return level; } set { if (value < PrintingPermissionLevel.NoPrinting || value > PrintingPermissionLevel.AllPrinting) { throw new ArgumentException(SR.GetString(SR.PrintingPermissionAttributeInvalidPermissionLevel), "value"); } level = value; } } /// [SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity")] public override IPermission CreatePermission() { if (Unrestricted) { return new PrintingPermission(PermissionState.Unrestricted); } else { return new PrintingPermission(level); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FixedSOMTableRow.cs
- PhonemeEventArgs.cs
- WebPartConnectionCollection.cs
- DynamicExpression.cs
- DateTimeOffset.cs
- ThousandthOfEmRealDoubles.cs
- ToolStripPanelSelectionGlyph.cs
- ProfileEventArgs.cs
- InputLanguage.cs
- Encoder.cs
- WinCategoryAttribute.cs
- WebUtil.cs
- WorkflowMarkupSerializerMapping.cs
- _AcceptOverlappedAsyncResult.cs
- Composition.cs
- RoleManagerSection.cs
- Button.cs
- CircleHotSpot.cs
- Point3D.cs
- ZipIOLocalFileDataDescriptor.cs
- Win32MouseDevice.cs
- LocalIdKeyIdentifierClause.cs
- Transactions.cs
- XPathNavigator.cs
- DataTableReaderListener.cs
- InsufficientExecutionStackException.cs
- WindowsFormsHostPropertyMap.cs
- ListControl.cs
- Rijndael.cs
- ProfileEventArgs.cs
- ComponentCollection.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- XmlDataCollection.cs
- XmlNullResolver.cs
- MultilineStringConverter.cs
- MemberRelationshipService.cs
- CreateUserWizardStep.cs
- SerializationStore.cs
- PersistenceTypeAttribute.cs
- FlagsAttribute.cs
- DeferredRunTextReference.cs
- TypeForwardedToAttribute.cs
- VersionedStream.cs
- WindowsFormsHost.cs
- ExtentJoinTreeNode.cs
- ModuleConfigurationInfo.cs
- TogglePattern.cs
- PointLightBase.cs
- TouchesOverProperty.cs
- UniqueConstraint.cs
- EventLogPermissionEntry.cs
- ReadonlyMessageFilter.cs
- XmlSchemaElement.cs
- WebPartConnectionsCancelEventArgs.cs
- GeometryHitTestResult.cs
- DropSource.cs
- Behavior.cs
- WmlValidationSummaryAdapter.cs
- printdlgexmarshaler.cs
- XmlSerializerNamespaces.cs
- WebDescriptionAttribute.cs
- Transform3DGroup.cs
- PaintValueEventArgs.cs
- GenericEnumerator.cs
- NGCPageContentCollectionSerializerAsync.cs
- UIElementParagraph.cs
- FontInfo.cs
- Stylesheet.cs
- DLinqAssociationProvider.cs
- TdsValueSetter.cs
- Content.cs
- StatusBar.cs
- PeerNameRegistration.cs
- Manipulation.cs
- Matrix.cs
- BitmapMetadataBlob.cs
- Stack.cs
- PixelFormats.cs
- MetadataCacheItem.cs
- MULTI_QI.cs
- KeyPressEvent.cs
- EntryIndex.cs
- SetIterators.cs
- RootProjectionNode.cs
- ConfigXmlCDataSection.cs
- SecurityTraceRecordHelper.cs
- IUnknownConstantAttribute.cs
- XLinq.cs
- JumpList.cs
- Filter.cs
- WindowsSolidBrush.cs
- Emitter.cs
- AliasedSlot.cs
- DiscoveryClientElement.cs
- LocalIdKeyIdentifierClause.cs
- ScriptHandlerFactory.cs
- MimeFormatter.cs
- AbstractDataSvcMapFileLoader.cs
- TextBoxAutoCompleteSourceConverter.cs
- SqlCharStream.cs