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
- PnrpPermission.cs
- BoundPropertyEntry.cs
- SendOperation.cs
- ConfigurationManagerHelperFactory.cs
- DeobfuscatingStream.cs
- TdsParserSafeHandles.cs
- CheckedListBox.cs
- StreamUpdate.cs
- MediaElement.cs
- FontStyle.cs
- ListMarkerSourceInfo.cs
- CollectionViewGroup.cs
- GridItemProviderWrapper.cs
- OrderedHashRepartitionStream.cs
- Debugger.cs
- ContentTextAutomationPeer.cs
- MULTI_QI.cs
- SectionVisual.cs
- RealizationDrawingContextWalker.cs
- ControllableStoryboardAction.cs
- EventLogPermission.cs
- NeedSkipTokenVisitor.cs
- WindowsAuthenticationEventArgs.cs
- Int16KeyFrameCollection.cs
- Visual.cs
- ImageSource.cs
- SelectionService.cs
- HwndSubclass.cs
- ClearCollection.cs
- JsonServiceDocumentSerializer.cs
- OdbcParameterCollection.cs
- XamlToRtfWriter.cs
- DataTableClearEvent.cs
- SafeMarshalContext.cs
- BitmapEffectGroup.cs
- StatusBarPanelClickEvent.cs
- odbcmetadatafactory.cs
- ColumnMapCopier.cs
- MexHttpsBindingElement.cs
- SourceLineInfo.cs
- COM2TypeInfoProcessor.cs
- List.cs
- ServicePoint.cs
- CatalogPartCollection.cs
- ViewBase.cs
- NullableFloatAverageAggregationOperator.cs
- QilTernary.cs
- LinqDataSourceHelper.cs
- ToolStripScrollButton.cs
- ExpandSegmentCollection.cs
- SecurityException.cs
- Ref.cs
- RecommendedAsConfigurableAttribute.cs
- XmlSchemaSimpleTypeUnion.cs
- StickyNoteHelper.cs
- ListBoxChrome.cs
- WebScriptServiceHostFactory.cs
- RemoteWebConfigurationHostStream.cs
- ThousandthOfEmRealDoubles.cs
- ListSourceHelper.cs
- TextTabProperties.cs
- TypedAsyncResult.cs
- TraceContextRecord.cs
- RichTextBox.cs
- AndCondition.cs
- EventRoute.cs
- GridViewAutoFormat.cs
- Selector.cs
- SqlConnectionPoolGroupProviderInfo.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- KeyEventArgs.cs
- XmlSchemaProviderAttribute.cs
- OpenTypeCommon.cs
- PackagePart.cs
- ToolStripHighContrastRenderer.cs
- XNameConverter.cs
- PrefixQName.cs
- XmlNode.cs
- XamlFigureLengthSerializer.cs
- StorageComplexTypeMapping.cs
- EditorBrowsableAttribute.cs
- Evaluator.cs
- NullableDoubleAverageAggregationOperator.cs
- WmlListAdapter.cs
- SqlParameterCollection.cs
- TypeConverterAttribute.cs
- PeerContact.cs
- ResXResourceSet.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- ToolStripContentPanel.cs
- RequestResizeEvent.cs
- ReferentialConstraint.cs
- IntranetCredentialPolicy.cs
- CodeMethodReturnStatement.cs
- ApplicationServiceHelper.cs
- Opcode.cs
- BuiltInExpr.cs
- PassportIdentity.cs
- NativeMethodsOther.cs
- CqlGenerator.cs