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
- XamlFilter.cs
- ShapeTypeface.cs
- BamlReader.cs
- CacheSection.cs
- RadioButtonBaseAdapter.cs
- RepeatInfo.cs
- TemplatedWizardStep.cs
- Query.cs
- AutomationPropertyInfo.cs
- _CacheStreams.cs
- CatalogPartChrome.cs
- SHA512Managed.cs
- UIElementIsland.cs
- CodeRegionDirective.cs
- Cursors.cs
- Types.cs
- ConstructorExpr.cs
- EventHandlersStore.cs
- XPathQilFactory.cs
- UnitySerializationHolder.cs
- HGlobalSafeHandle.cs
- HttpCookie.cs
- ObjectDataSource.cs
- DBCSCodePageEncoding.cs
- WmpBitmapDecoder.cs
- ZipIOCentralDirectoryBlock.cs
- CheckBoxRenderer.cs
- TargetException.cs
- KeyedCollection.cs
- HtmlElementCollection.cs
- FrameDimension.cs
- JsonReaderDelegator.cs
- HtmlEncodedRawTextWriter.cs
- SamlAdvice.cs
- EventMetadata.cs
- AlphabeticalEnumConverter.cs
- XmlEventCache.cs
- AssemblyInfo.cs
- RegexCompiler.cs
- XmlNamespaceManager.cs
- HScrollBar.cs
- MissingManifestResourceException.cs
- XPathNodeHelper.cs
- DateTimeHelper.cs
- WizardStepBase.cs
- ZoneLinkButton.cs
- DbProviderFactories.cs
- CollectionViewGroupInternal.cs
- TextEffectResolver.cs
- ObjectParameter.cs
- ToolZone.cs
- CompoundFileIOPermission.cs
- CodeDOMUtility.cs
- GraphicsPath.cs
- XmlObjectSerializerContext.cs
- ActivityBuilderHelper.cs
- TdsParserSessionPool.cs
- XmlDeclaration.cs
- StrokeCollectionDefaultValueFactory.cs
- SpanIndex.cs
- UnmanagedBitmapWrapper.cs
- CodeDomDesignerLoader.cs
- Int32AnimationBase.cs
- StickyNoteAnnotations.cs
- TdsParserStaticMethods.cs
- RegexCompiler.cs
- MetadataStore.cs
- DLinqDataModelProvider.cs
- FacetValueContainer.cs
- UndoManager.cs
- WebExceptionStatus.cs
- MonitorWrapper.cs
- DescendantQuery.cs
- SmiContext.cs
- TreeView.cs
- PlatformNotSupportedException.cs
- StylusPointPropertyUnit.cs
- NavigationEventArgs.cs
- KeyInfo.cs
- AmbientLight.cs
- ReadOnlyCollectionBase.cs
- PrivilegeNotHeldException.cs
- ClientEventManager.cs
- VisualStyleTypesAndProperties.cs
- CellTreeSimplifier.cs
- FrameworkEventSource.cs
- ToolStripComboBox.cs
- PointCollectionConverter.cs
- WorkflowServiceHost.cs
- ConfigurationStrings.cs
- Size.cs
- ToolStripDesignerAvailabilityAttribute.cs
- DBSqlParserTable.cs
- CngAlgorithmGroup.cs
- ErrorWebPart.cs
- WaitHandle.cs
- ExtenderControl.cs
- TripleDESCryptoServiceProvider.cs
- Brush.cs
- AddingNewEventArgs.cs