Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Text / EncoderBestFitFallback.cs / 1305376 / EncoderBestFitFallback.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // EncoderBestFitFallback.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.Globalization; using System.Text; using System.Threading; using System.Diagnostics.Contracts; [Serializable] internal class InternalEncoderBestFitFallback : EncoderFallback { // Our variables internal Encoding encoding = null; internal char[] arrayBestFit = null; internal InternalEncoderBestFitFallback(Encoding encoding) { // Need to load our replacement characters table. this.encoding = encoding; this.bIsMicrosoftBestFitFallback = true; } public override EncoderFallbackBuffer CreateFallbackBuffer() { return new InternalEncoderBestFitFallbackBuffer(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) { InternalEncoderBestFitFallback that = value as InternalEncoderBestFitFallback; if (that != null) { return (this.encoding.CodePage == that.encoding.CodePage); } return (false); } public override int GetHashCode() { return this.encoding.CodePage; } } internal sealed class InternalEncoderBestFitFallbackBuffer : EncoderFallbackBuffer { // Our variables private char cBestFit = '\0'; private InternalEncoderBestFitFallback oFallback; private int iCount = -1; private int iSize; // 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
- WindowsBrush.cs
- HttpApplication.cs
- TextFormatter.cs
- StringUtil.cs
- DrawingImage.cs
- TypeExtensions.cs
- _CommandStream.cs
- SamlAuthenticationClaimResource.cs
- SelectionChangedEventArgs.cs
- ResourceProviderFactory.cs
- EditorAttribute.cs
- AnonymousIdentificationModule.cs
- AdapterDictionary.cs
- _IPv6Address.cs
- ContractNamespaceAttribute.cs
- LinkedDataMemberFieldEditor.cs
- ProviderSettingsCollection.cs
- DocumentViewerBaseAutomationPeer.cs
- DoWorkEventArgs.cs
- FormClosedEvent.cs
- XsltSettings.cs
- UniqueEventHelper.cs
- Listbox.cs
- SspiSecurityTokenParameters.cs
- FieldNameLookup.cs
- Partitioner.cs
- ResourceReferenceExpression.cs
- InfoCardClaimCollection.cs
- UriWriter.cs
- TypeUsage.cs
- SiteMapPath.cs
- DSASignatureFormatter.cs
- EnumConverter.cs
- XmlC14NWriter.cs
- WorkflowViewStateService.cs
- RelatedImageListAttribute.cs
- HtmlInputCheckBox.cs
- NoneExcludedImageIndexConverter.cs
- DesignerSerializationVisibilityAttribute.cs
- InheritanceAttribute.cs
- COM2PropertyBuilderUITypeEditor.cs
- InputProcessorProfilesLoader.cs
- DataSvcMapFileSerializer.cs
- XmlAnyAttributeAttribute.cs
- CompiledRegexRunner.cs
- EditingMode.cs
- ToolStripSettings.cs
- Debug.cs
- OpenTypeLayout.cs
- FontSourceCollection.cs
- JulianCalendar.cs
- ActiveDocumentEvent.cs
- WebPartZoneCollection.cs
- Exceptions.cs
- PartialCachingControl.cs
- ReferenceService.cs
- OlePropertyStructs.cs
- HtmlHead.cs
- SizeChangedEventArgs.cs
- Thread.cs
- OleDbMetaDataFactory.cs
- assemblycache.cs
- ObjectDataSourceDisposingEventArgs.cs
- StickyNoteContentControl.cs
- SizeFConverter.cs
- Sql8ConformanceChecker.cs
- BufferCache.cs
- EdmToObjectNamespaceMap.cs
- SpeechAudioFormatInfo.cs
- CodeStatement.cs
- XmlEventCache.cs
- XmlNamedNodeMap.cs
- StrongNameSignatureInformation.cs
- IItemContainerGenerator.cs
- SystemGatewayIPAddressInformation.cs
- FormViewModeEventArgs.cs
- WSHttpSecurityElement.cs
- BitmapEffectGroup.cs
- SecurityManager.cs
- RectAnimationBase.cs
- HtmlControlPersistable.cs
- DataControlImageButton.cs
- DesignerValidatorAdapter.cs
- EventLogEntry.cs
- mansign.cs
- Cursors.cs
- X509Certificate2.cs
- DatatypeImplementation.cs
- PropertyInfoSet.cs
- IncrementalHitTester.cs
- Schema.cs
- TabControlAutomationPeer.cs
- ExtractorMetadata.cs
- Run.cs
- SqlDataSourceCache.cs
- EventLogEntryCollection.cs
- DescendentsWalkerBase.cs
- XmlCharacterData.cs
- DataViewSetting.cs
- RuleSettings.cs