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
- KnownColorTable.cs
- exports.cs
- DbDataRecord.cs
- DrawItemEvent.cs
- GlobalizationAssembly.cs
- FamilyCollection.cs
- DtrList.cs
- FastEncoderWindow.cs
- EnvelopedPkcs7.cs
- BeginEvent.cs
- LinkClickEvent.cs
- KeyGestureConverter.cs
- SchemaTableOptionalColumn.cs
- HtmlAnchor.cs
- Light.cs
- recordstate.cs
- EditorZoneBase.cs
- ServiceManager.cs
- PropertyToken.cs
- BufferedStream.cs
- DataGridViewRowPrePaintEventArgs.cs
- DataGridViewCheckBoxColumn.cs
- RbTree.cs
- FormViewUpdateEventArgs.cs
- Gdiplus.cs
- Calendar.cs
- UnsignedPublishLicense.cs
- SafeHGlobalHandleCritical.cs
- ListMarkerLine.cs
- GenericsNotImplementedException.cs
- OpCodes.cs
- PrePrepareMethodAttribute.cs
- CalculatedColumn.cs
- CqlWriter.cs
- PersonalizationProviderHelper.cs
- DocobjHost.cs
- AssemblyNameProxy.cs
- TransformCryptoHandle.cs
- Ppl.cs
- Calendar.cs
- DoubleCollectionConverter.cs
- SetStoryboardSpeedRatio.cs
- TextElementAutomationPeer.cs
- Unit.cs
- WindowsSecurityTokenAuthenticator.cs
- ScrollBarAutomationPeer.cs
- InteropExecutor.cs
- ChangeBlockUndoRecord.cs
- TreeNodeEventArgs.cs
- ArcSegment.cs
- ProfileManager.cs
- FormatConvertedBitmap.cs
- ItemContainerGenerator.cs
- xsdvalidator.cs
- ToolStripSettings.cs
- DbParameterHelper.cs
- SystemSounds.cs
- VirtualDirectoryMappingCollection.cs
- QilLiteral.cs
- DataTableExtensions.cs
- QuaternionRotation3D.cs
- XsltException.cs
- MethodBuilderInstantiation.cs
- ZoneLinkButton.cs
- TextTreeTextElementNode.cs
- ProcessInfo.cs
- ZipIOExtraFieldZip64Element.cs
- TimeSpanValidatorAttribute.cs
- AuthenticationManager.cs
- MachineKeySection.cs
- StringArrayConverter.cs
- WebControlAdapter.cs
- WebHttpSecurityModeHelper.cs
- BCLDebug.cs
- NestPullup.cs
- Timer.cs
- AttributeEmitter.cs
- PickBranchDesigner.xaml.cs
- DesignConnectionCollection.cs
- GestureRecognitionResult.cs
- VisualStyleElement.cs
- HelpInfo.cs
- Hashtable.cs
- CompiledIdentityConstraint.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- PartitionResolver.cs
- WindowInteropHelper.cs
- ACE.cs
- SubMenuStyle.cs
- XmlSchemaComplexContentExtension.cs
- LineServices.cs
- XmlEntity.cs
- Row.cs
- ListDictionaryInternal.cs
- ComponentRenameEvent.cs
- DeflateEmulationStream.cs
- RenamedEventArgs.cs
- Image.cs
- TemplateLookupAction.cs
- TypeElementCollection.cs