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
- ImageMapEventArgs.cs
- TextEncodedRawTextWriter.cs
- XmlAttribute.cs
- ObjectHelper.cs
- PropertyGridCommands.cs
- CodeDirectionExpression.cs
- ArgumentNullException.cs
- ToolStripScrollButton.cs
- StaticDataManager.cs
- Int32Animation.cs
- PenThreadPool.cs
- MethodCallTranslator.cs
- TextTreeTextNode.cs
- SessionState.cs
- WebPartDeleteVerb.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- BoundField.cs
- ProviderConnectionPoint.cs
- TaskExceptionHolder.cs
- StyleSheetComponentEditor.cs
- ClientScriptManagerWrapper.cs
- DbProviderFactories.cs
- PathFigureCollection.cs
- DataGridViewCellStateChangedEventArgs.cs
- Brush.cs
- _SpnDictionary.cs
- AttachInfo.cs
- SqlFormatter.cs
- regiisutil.cs
- FontDialog.cs
- AbstractDataSvcMapFileLoader.cs
- IdentityHolder.cs
- ToolstripProfessionalRenderer.cs
- PathTooLongException.cs
- ClassDataContract.cs
- QuotedStringWriteStateInfo.cs
- _LocalDataStoreMgr.cs
- SafeReadContext.cs
- PipeSecurity.cs
- UInt16Converter.cs
- CodeNamespaceImportCollection.cs
- DiscoveryClientDocuments.cs
- TextTreeDeleteContentUndoUnit.cs
- BitmapData.cs
- XmlObjectSerializerReadContext.cs
- ResourcePool.cs
- SessionParameter.cs
- MenuItemCollection.cs
- CustomBinding.cs
- EditorAttributeInfo.cs
- DataColumnCollection.cs
- XPathNodeList.cs
- ConfigXmlCDataSection.cs
- ConversionValidationRule.cs
- ApplicationId.cs
- AccessedThroughPropertyAttribute.cs
- SrgsText.cs
- CodeDirectoryCompiler.cs
- ADMembershipProvider.cs
- DataControlReference.cs
- ItemList.cs
- ToolbarAUtomationPeer.cs
- SystemIPInterfaceProperties.cs
- addressfiltermode.cs
- ListViewTableRow.cs
- RecordsAffectedEventArgs.cs
- Transform.cs
- MediaElement.cs
- METAHEADER.cs
- HtmlInputHidden.cs
- TcpTransportSecurityElement.cs
- NetCodeGroup.cs
- ItemAutomationPeer.cs
- AttributeUsageAttribute.cs
- PersonalizableAttribute.cs
- ComponentDispatcherThread.cs
- Collection.cs
- CodeMethodMap.cs
- _NtlmClient.cs
- Pen.cs
- GeometryDrawing.cs
- BuildManagerHost.cs
- CreateRefExpr.cs
- StackOverflowException.cs
- ElementsClipboardData.cs
- WorkflowInstanceContextProvider.cs
- DateBoldEvent.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- ArraySubsetEnumerator.cs
- NavigatorOutput.cs
- RayMeshGeometry3DHitTestResult.cs
- HTMLTextWriter.cs
- JournalNavigationScope.cs
- NativeCppClassAttribute.cs
- DataGridViewCellStateChangedEventArgs.cs
- PrincipalPermission.cs
- GridViewAutomationPeer.cs
- FixedDocumentPaginator.cs
- BindingElementCollection.cs
- ModifyActivitiesPropertyDescriptor.cs