Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Text / DecoderBestFitFallback.cs / 1305376 / DecoderBestFitFallback.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // DecoderBestFitFallback.cs // // This is used internally to create best fit behavior as per the original windows best fit behavior. // namespace System.Text { using System; using System.Text; using System.Threading; using System.Diagnostics.Contracts; [Serializable] internal sealed class InternalDecoderBestFitFallback : DecoderFallback { // Our variables internal Encoding encoding = null; internal char[] arrayBestFit = null; internal char cReplacement = '?'; internal InternalDecoderBestFitFallback(Encoding encoding) { // Need to load our replacement characters table. this.encoding = encoding; this.bIsMicrosoftBestFitFallback = true; } public override DecoderFallbackBuffer CreateFallbackBuffer() { return new InternalDecoderBestFitFallbackBuffer(this); } // Maximum number of characters that this instance of this fallback could return public override int MaxCharCount { get { return 1; } } public override bool Equals(Object value) { InternalDecoderBestFitFallback that = value as InternalDecoderBestFitFallback; if (that != null) { return (this.encoding.CodePage == that.encoding.CodePage); } return (false); } public override int GetHashCode() { return this.encoding.CodePage; } } internal sealed class InternalDecoderBestFitFallbackBuffer : DecoderFallbackBuffer { // Our variables internal char cBestFit = '\0'; internal int iCount = -1; internal int iSize; private InternalDecoderBestFitFallback oFallback; // Private object for locking instead of locking on a public type for SQL reliability work. private static Object s_InternalSyncObject; private static Object InternalSyncObject { get { if (s_InternalSyncObject == null) { Object o = new Object(); Interlocked.CompareExchange
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataServiceQueryOfT.cs
- UmAlQuraCalendar.cs
- ResourceProviderFactory.cs
- ServiceThrottlingElement.cs
- _TLSstream.cs
- CheckBox.cs
- WebBrowserEvent.cs
- Int32Rect.cs
- CheckBoxPopupAdapter.cs
- AnimationClock.cs
- TrackingMemoryStreamFactory.cs
- WebControlAdapter.cs
- AnnotationObservableCollection.cs
- TypeConverterHelper.cs
- HebrewNumber.cs
- PropertySourceInfo.cs
- Font.cs
- QueryInterceptorAttribute.cs
- SAPICategories.cs
- OrderingExpression.cs
- DispatchChannelSink.cs
- ZipIOModeEnforcingStream.cs
- CodeMemberMethod.cs
- EventLogPermissionEntry.cs
- PreservationFileReader.cs
- PersonalizationProviderHelper.cs
- KerberosTicketHashIdentifierClause.cs
- Style.cs
- SQLDateTime.cs
- XmlSchemaImport.cs
- TypedServiceOperationListItem.cs
- SystemTcpConnection.cs
- FreezableOperations.cs
- MetadataArtifactLoaderComposite.cs
- Frame.cs
- SignedPkcs7.cs
- ContentHostHelper.cs
- AnimationClockResource.cs
- SelectingProviderEventArgs.cs
- TransactionFlowAttribute.cs
- DateTimeParse.cs
- HttpPostProtocolImporter.cs
- AsyncPostBackTrigger.cs
- Soap.cs
- AtomicFile.cs
- ProjectedWrapper.cs
- ErrorFormatter.cs
- TextEditorCopyPaste.cs
- FormatConvertedBitmap.cs
- MulticastOption.cs
- _RequestLifetimeSetter.cs
- X509AsymmetricSecurityKey.cs
- ExtensibleClassFactory.cs
- LinqDataSourceContextEventArgs.cs
- SqlDelegatedTransaction.cs
- ModelTreeEnumerator.cs
- _TransmitFileOverlappedAsyncResult.cs
- _DomainName.cs
- SimpleRecyclingCache.cs
- XmlnsCache.cs
- HttpServerVarsCollection.cs
- LocatorPartList.cs
- SerializationInfoEnumerator.cs
- ExecutedRoutedEventArgs.cs
- ClientBuildManager.cs
- DockPattern.cs
- IfAction.cs
- ProfileGroupSettingsCollection.cs
- XmlSchemaAttributeGroupRef.cs
- ConstructorNeedsTagAttribute.cs
- ReverseInheritProperty.cs
- ConstantCheck.cs
- SqlFormatter.cs
- DataGridViewRowHeaderCell.cs
- WorkflowWebService.cs
- EntityDataSourceState.cs
- wgx_render.cs
- GridProviderWrapper.cs
- EncodingDataItem.cs
- DesignerTransactionCloseEvent.cs
- TailPinnedEventArgs.cs
- ResourceManager.cs
- SQLDecimal.cs
- HttpCacheVaryByContentEncodings.cs
- EventListener.cs
- OrCondition.cs
- SoapConverter.cs
- VsPropertyGrid.cs
- ReferencedCollectionType.cs
- SynchronizingStream.cs
- SqlDependencyUtils.cs
- ScrollViewer.cs
- ServiceParser.cs
- DbModificationClause.cs
- Operators.cs
- SurrogateEncoder.cs
- XmlArrayItemAttributes.cs
- InkPresenter.cs
- _BasicClient.cs
- BitmapEffectInput.cs