Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Core / CSharp / System / Windows / Media / Imaging / BitmapInitialize.cs / 1 / BitmapInitialize.cs
//------------------------------------------------------------------------------ // Microsoft Avalon // Copyright (c) Microsoft Corporation. All Rights Reserved. // // File: BitmapInitialize.cs // //----------------------------------------------------------------------------- using System; using System.IO; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Reflection; using MS.Internal; using MS.Win32; using System.Security; using System.Security.Permissions; using System.Diagnostics; using System.Windows.Media; using System.Globalization; using System.Runtime.InteropServices; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media.Imaging { #region BitmapInitialize ////// Utility class providing support for ISupportInitialize /// internal class BitmapInitialize : ISupportInitialize { public BitmapInitialize() { } public void BeginInit() { if (IsInitAtLeastOnce) throw new InvalidOperationException(SR.Get(SRID.Image_OnlyOneInit, null)); if (IsInInit) throw new InvalidOperationException(SR.Get(SRID.Image_InInitialize, null)); _inInit = true; } public void EndInit() { if (!IsInInit) throw new InvalidOperationException(SR.Get(SRID.Image_EndInitWithoutBeginInit, null)); _inInit = false; _isInitialized = true; } public void SetPrologue() { if (!IsInInit) { throw new InvalidOperationException(SR.Get(SRID.Image_SetPropertyOutsideBeginEndInit, null)); } } public bool IsInInit { get { return _inInit; } } public bool IsInitAtLeastOnce { get { return _isInitialized; } } public void EnsureInitializedComplete() { if (IsInInit) throw new InvalidOperationException(SR.Get(SRID.Image_InitializationIncomplete, null)); if (!IsInitAtLeastOnce) throw new InvalidOperationException(SR.Get(SRID.Image_NotInitialized, null)); } public void Reset() { _inInit = false; _isInitialized = false; } private bool _inInit = false; private bool _isInitialized = false; } #endregion } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // Microsoft Avalon // Copyright (c) Microsoft Corporation. All Rights Reserved. // // File: BitmapInitialize.cs // //----------------------------------------------------------------------------- using System; using System.IO; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Reflection; using MS.Internal; using MS.Win32; using System.Security; using System.Security.Permissions; using System.Diagnostics; using System.Windows.Media; using System.Globalization; using System.Runtime.InteropServices; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media.Imaging { #region BitmapInitialize ////// Utility class providing support for ISupportInitialize /// internal class BitmapInitialize : ISupportInitialize { public BitmapInitialize() { } public void BeginInit() { if (IsInitAtLeastOnce) throw new InvalidOperationException(SR.Get(SRID.Image_OnlyOneInit, null)); if (IsInInit) throw new InvalidOperationException(SR.Get(SRID.Image_InInitialize, null)); _inInit = true; } public void EndInit() { if (!IsInInit) throw new InvalidOperationException(SR.Get(SRID.Image_EndInitWithoutBeginInit, null)); _inInit = false; _isInitialized = true; } public void SetPrologue() { if (!IsInInit) { throw new InvalidOperationException(SR.Get(SRID.Image_SetPropertyOutsideBeginEndInit, null)); } } public bool IsInInit { get { return _inInit; } } public bool IsInitAtLeastOnce { get { return _isInitialized; } } public void EnsureInitializedComplete() { if (IsInInit) throw new InvalidOperationException(SR.Get(SRID.Image_InitializationIncomplete, null)); if (!IsInitAtLeastOnce) throw new InvalidOperationException(SR.Get(SRID.Image_NotInitialized, null)); } public void Reset() { _inInit = false; _isInitialized = false; } private bool _inInit = false; private bool _isInitialized = false; } #endregion } // 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
- GlyphRunDrawing.cs
- TableParaClient.cs
- EventListener.cs
- RectValueSerializer.cs
- WebCodeGenerator.cs
- Size3D.cs
- JavascriptCallbackResponseProperty.cs
- ConfigUtil.cs
- TextElementEnumerator.cs
- Composition.cs
- SourceElementsCollection.cs
- RuntimeConfigurationRecord.cs
- CodeRemoveEventStatement.cs
- TableParaClient.cs
- AnimationClockResource.cs
- LayoutInformation.cs
- ReferenceEqualityComparer.cs
- _FtpDataStream.cs
- datacache.cs
- BatchStream.cs
- ToolTipService.cs
- EdmComplexTypeAttribute.cs
- _Rfc2616CacheValidators.cs
- CompModSwitches.cs
- GenericXmlSecurityTokenAuthenticator.cs
- RuleConditionDialog.cs
- mda.cs
- ProviderCollection.cs
- HtmlEmptyTagControlBuilder.cs
- TransactionChannelListener.cs
- IListConverters.cs
- XmlIgnoreAttribute.cs
- MessageBuilder.cs
- x509utils.cs
- LogReserveAndAppendState.cs
- Solver.cs
- ReadOnlyDictionary.cs
- SystemWebCachingSectionGroup.cs
- RIPEMD160.cs
- CompoundFileIOPermission.cs
- MonikerBuilder.cs
- MergeFailedEvent.cs
- FilterException.cs
- ImportContext.cs
- CopyNamespacesAction.cs
- MemoryMappedFileSecurity.cs
- NameScope.cs
- CodeSnippetCompileUnit.cs
- MatrixAnimationUsingKeyFrames.cs
- TraceSwitch.cs
- PrimitiveCodeDomSerializer.cs
- SHA384.cs
- WebResourceUtil.cs
- AdPostCacheSubstitution.cs
- StandardToolWindows.cs
- StaticSiteMapProvider.cs
- StrongTypingException.cs
- SchemaEntity.cs
- CacheOutputQuery.cs
- PeerEndPoint.cs
- DataGridViewComboBoxColumn.cs
- SiteMapDataSourceView.cs
- TimeZone.cs
- SspiWrapper.cs
- SqlDataSourceSelectingEventArgs.cs
- PackageStore.cs
- AdornedElementPlaceholder.cs
- bidPrivateBase.cs
- RC2.cs
- InputDevice.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- Nodes.cs
- MouseWheelEventArgs.cs
- StoreContentChangedEventArgs.cs
- LoginCancelEventArgs.cs
- BindingEntityInfo.cs
- FileDialog_Vista.cs
- ZipIOCentralDirectoryBlock.cs
- RegexParser.cs
- FontConverter.cs
- CommentEmitter.cs
- ObjectListField.cs
- RTTypeWrapper.cs
- ReachSerializer.cs
- XmlSchemaElement.cs
- DefaultTraceListener.cs
- OdbcUtils.cs
- ErrorEventArgs.cs
- XmlSchemaParticle.cs
- DefaultPropertyAttribute.cs
- HwndSource.cs
- BounceEase.cs
- EventLogPermissionEntryCollection.cs
- SymbolEqualComparer.cs
- ThrowHelper.cs
- RijndaelManaged.cs
- ReaderWriterLock.cs
- CellParagraph.cs
- TextSelection.cs
- UrlAuthorizationModule.cs