Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / Imaging / PngBitmapDecoder.cs / 1305600 / PngBitmapDecoder.cs
//------------------------------------------------------------------------------
// Microsoft Avalon
// Copyright (c) Microsoft Corporation, All Rights Reserved
//
// File: PngBitmapDecoder.cs
//
//-----------------------------------------------------------------------------
using System;
using System.IO;
using System.Collections;
using System.Security;
using System.Security.Permissions;
using System.ComponentModel;
using System.ComponentModel.Design.Serialization;
using System.Reflection;
using Microsoft.Win32.SafeHandles;
using MS.Internal;
using System.Diagnostics;
using System.Windows.Media;
using System.Globalization;
using System.Runtime.InteropServices;
namespace System.Windows.Media.Imaging
{
#region PngBitmapDecoder
///
/// The built-in Microsoft Png (Bitmap) Decoder.
///
public sealed class PngBitmapDecoder : BitmapDecoder
{
///
/// Don't allow construction of a decoder with no params
///
private PngBitmapDecoder()
{
}
///
/// Create a PngBitmapDecoder given the Uri
///
/// Uri to decode
/// Bitmap Create Options
/// Bitmap Caching Option
///
/// Critical - access critical resource
/// PublicOK - inputs verified or safe
///
[SecurityCritical ]
public PngBitmapDecoder(
Uri bitmapUri,
BitmapCreateOptions createOptions,
BitmapCacheOption cacheOption
) : base(bitmapUri, createOptions, cacheOption, MILGuidData.GUID_ContainerFormatPng)
{
}
///
/// If this decoder cannot handle the bitmap stream, it will throw an exception.
///
/// Stream to decode
/// Bitmap Create Options
/// Bitmap Caching Option
///
/// Critical - access critical resource
/// PublicOK - inputs verified or safe
///
[SecurityCritical ]
public PngBitmapDecoder(
Stream bitmapStream,
BitmapCreateOptions createOptions,
BitmapCacheOption cacheOption
) : base(bitmapStream, createOptions, cacheOption, MILGuidData.GUID_ContainerFormatPng)
{
}
///
/// Internal Constructor
///
///
/// Critical: Uses a SafeFileHandle, which is a SecurityCritical type (in v4).
/// Calls SecurityCritical base class constructor.
///
[SecurityCritical]
internal PngBitmapDecoder(
SafeMILHandle decoderHandle,
BitmapDecoder decoder,
Uri baseUri,
Uri uri,
Stream stream,
BitmapCreateOptions createOptions,
BitmapCacheOption cacheOption,
bool insertInDecoderCache,
bool originalWritable,
Stream uriStream,
UnmanagedMemoryStream unmanagedMemoryStream,
SafeFileHandle safeFilehandle
) : base(decoderHandle, decoder, baseUri, uri, stream, createOptions, cacheOption, insertInDecoderCache, originalWritable, uriStream, unmanagedMemoryStream, safeFilehandle)
{
}
#region Internal Abstract
/// Need to implement this to derive from the "sealed" object
internal override void SealObject()
{
throw new NotImplementedException();
}
#endregion
}
#endregion
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
// Microsoft Avalon
// Copyright (c) Microsoft Corporation, All Rights Reserved
//
// File: PngBitmapDecoder.cs
//
//-----------------------------------------------------------------------------
using System;
using System.IO;
using System.Collections;
using System.Security;
using System.Security.Permissions;
using System.ComponentModel;
using System.ComponentModel.Design.Serialization;
using System.Reflection;
using Microsoft.Win32.SafeHandles;
using MS.Internal;
using System.Diagnostics;
using System.Windows.Media;
using System.Globalization;
using System.Runtime.InteropServices;
namespace System.Windows.Media.Imaging
{
#region PngBitmapDecoder
///
/// The built-in Microsoft Png (Bitmap) Decoder.
///
public sealed class PngBitmapDecoder : BitmapDecoder
{
///
/// Don't allow construction of a decoder with no params
///
private PngBitmapDecoder()
{
}
///
/// Create a PngBitmapDecoder given the Uri
///
/// Uri to decode
/// Bitmap Create Options
/// Bitmap Caching Option
///
/// Critical - access critical resource
/// PublicOK - inputs verified or safe
///
[SecurityCritical ]
public PngBitmapDecoder(
Uri bitmapUri,
BitmapCreateOptions createOptions,
BitmapCacheOption cacheOption
) : base(bitmapUri, createOptions, cacheOption, MILGuidData.GUID_ContainerFormatPng)
{
}
///
/// If this decoder cannot handle the bitmap stream, it will throw an exception.
///
/// Stream to decode
/// Bitmap Create Options
/// Bitmap Caching Option
///
/// Critical - access critical resource
/// PublicOK - inputs verified or safe
///
[SecurityCritical ]
public PngBitmapDecoder(
Stream bitmapStream,
BitmapCreateOptions createOptions,
BitmapCacheOption cacheOption
) : base(bitmapStream, createOptions, cacheOption, MILGuidData.GUID_ContainerFormatPng)
{
}
///
/// Internal Constructor
///
///
/// Critical: Uses a SafeFileHandle, which is a SecurityCritical type (in v4).
/// Calls SecurityCritical base class constructor.
///
[SecurityCritical]
internal PngBitmapDecoder(
SafeMILHandle decoderHandle,
BitmapDecoder decoder,
Uri baseUri,
Uri uri,
Stream stream,
BitmapCreateOptions createOptions,
BitmapCacheOption cacheOption,
bool insertInDecoderCache,
bool originalWritable,
Stream uriStream,
UnmanagedMemoryStream unmanagedMemoryStream,
SafeFileHandle safeFilehandle
) : base(decoderHandle, decoder, baseUri, uri, stream, createOptions, cacheOption, insertInDecoderCache, originalWritable, uriStream, unmanagedMemoryStream, safeFilehandle)
{
}
#region Internal Abstract
/// Need to implement this to derive from the "sealed" object
internal override void SealObject()
{
throw new NotImplementedException();
}
#endregion
}
#endregion
}
// 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
- BooleanAnimationBase.cs
- XamlSerializationHelper.cs
- SynchronizationFilter.cs
- InputLanguageProfileNotifySink.cs
- StrokeRenderer.cs
- ToolStripPanelRenderEventArgs.cs
- Queue.cs
- ConfigurationValidatorAttribute.cs
- VirtualPath.cs
- NavigationService.cs
- VBCodeProvider.cs
- ToolStripDropDownButton.cs
- AssemblyInfo.cs
- ZipIOExtraField.cs
- PropertyDescriptor.cs
- ThumbButtonInfo.cs
- DurableDispatcherAddressingFault.cs
- __ConsoleStream.cs
- TypeResolver.cs
- DesignerOptionService.cs
- ContentValidator.cs
- ReachSerializationCacheItems.cs
- AccessControlEntry.cs
- LOSFormatter.cs
- Compensation.cs
- HttpEncoder.cs
- TraceData.cs
- SkinBuilder.cs
- HandlerBase.cs
- ConstructorArgumentAttribute.cs
- DataGridDetailsPresenterAutomationPeer.cs
- StrokeCollection2.cs
- TracingConnectionListener.cs
- PermissionSetTriple.cs
- DebugView.cs
- BuiltInExpr.cs
- ContextStack.cs
- DefaultTextStore.cs
- Pts.cs
- OdbcConnectionOpen.cs
- BrushMappingModeValidation.cs
- CacheMemory.cs
- GroupDescription.cs
- MSAAEventDispatcher.cs
- EntitySqlQueryCacheKey.cs
- CachedFontFace.cs
- GlobalItem.cs
- FormsIdentity.cs
- Mappings.cs
- EventLogInternal.cs
- parserscommon.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- SqlMethodCallConverter.cs
- DocumentViewerConstants.cs
- CodeVariableDeclarationStatement.cs
- SelectionChangedEventArgs.cs
- Sequence.cs
- Image.cs
- _SslState.cs
- ToolStripRenderEventArgs.cs
- LinqDataSourceDisposeEventArgs.cs
- XmlDigitalSignatureProcessor.cs
- PointConverter.cs
- ControlType.cs
- TrustLevelCollection.cs
- FormatPage.cs
- SqlReferenceCollection.cs
- RijndaelManagedTransform.cs
- AdapterUtil.cs
- ComponentSerializationService.cs
- ComponentEditorPage.cs
- ButtonBase.cs
- HashMembershipCondition.cs
- ServiceBusyException.cs
- Console.cs
- AutoGeneratedField.cs
- PrincipalPermission.cs
- HealthMonitoringSection.cs
- KeyGestureValueSerializer.cs
- IntegerValidatorAttribute.cs
- future.cs
- HMACMD5.cs
- KeyboardNavigation.cs
- BrushProxy.cs
- AxParameterData.cs
- TriggerCollection.cs
- AnchoredBlock.cs
- KnownBoxes.cs
- ListItemParagraph.cs
- ConstantCheck.cs
- CriticalExceptions.cs
- SqlInternalConnection.cs
- CachedBitmap.cs
- ScaleTransform.cs
- TextServicesProperty.cs
- NamespaceList.cs
- ZipIOModeEnforcingStream.cs
- _AcceptOverlappedAsyncResult.cs
- XmlUnspecifiedAttribute.cs
- BindingBase.cs