System.Xml.CharEntityEncoderFallbackBuffer.Fallback C# (CSharp) Method

Fallback() public method

public Fallback ( char charUnknown, int index ) : bool
charUnknown char
index int
return bool
        public override bool Fallback( char charUnknown, int index ) {
            // If we are already in fallback, throw, it's probably at the suspect character in charEntity
            if ( charEntityIndex >= 0 ) {
                (new EncoderExceptionFallbackBuffer()).Fallback( charUnknown, index );
            }
 
            // find out if we can replace the character with entity
            if ( parent.CanReplaceAt( index ) ) {
                // Create the replacement character entity
                charEntity = string.Format( CultureInfo.InvariantCulture, "&#x{0:X};", new object[] { (int)charUnknown } );
                charEntityIndex = 0;
                return true;
            }
            else {
                EncoderFallbackBuffer errorFallbackBuffer = ( new EncoderExceptionFallback() ).CreateFallbackBuffer();
                errorFallbackBuffer.Fallback( charUnknown, index );
                return false;
            }
        }
 

Same methods

CharEntityEncoderFallbackBuffer::Fallback ( char charUnknownHigh, char charUnknownLow, int index ) : bool