using System; namespace System.Text { /// Represents a substitute input string that is used when the original input character cannot be encoded. This class cannot be inherited. /// 2 // Token: 0x020005F0 RID: 1520 public sealed class EncoderReplacementFallbackBuffer : EncoderFallbackBuffer { /// Initializes a new instance of the class using the value of a object. /// A object. // Token: 0x06003740 RID: 14144 RVA: 0x000BCEF8 File Offset: 0x000BB0F8 public EncoderReplacementFallbackBuffer(EncoderReplacementFallback fallback) { if (fallback == null) { throw new ArgumentNullException("fallback"); } this.replacement = fallback.DefaultString; this.current = 0; } /// Gets the number of characters in the replacement fallback buffer that remain to be processed. /// The number of characters in the replacement fallback buffer that have not yet been processed. /// 1 // Token: 0x17000AD2 RID: 2770 // (get) Token: 0x06003741 RID: 14145 RVA: 0x000BCF30 File Offset: 0x000BB130 public override int Remaining { get { return this.replacement.Length - this.current; } } /// Prepares the replacement fallback buffer to use the current replacement string. /// true if the replacement string is not empty; false if the replacement string is empty. /// An input character. This parameter is ignored in this operation unless an exception is thrown. /// The index position of the character in the input buffer. This parameter is ignored in this operation. /// This method is called again before the method has read all the characters in the replacement fallback buffer. /// 1 // Token: 0x06003742 RID: 14146 RVA: 0x000BCF44 File Offset: 0x000BB144 public override bool Fallback(char charUnknown, int index) { return this.Fallback(index); } /// Indicates whether a replacement string can be used when an input surrogate pair cannot be encoded, or whether the surrogate pair can be ignored. Parameters specify the surrogate pair and the index position of the pair in the input. /// true if the replacement string is not empty; false if the replacement string is empty. /// The high surrogate of the input pair. /// The low surrogate of the input pair. /// The index position of the surrogate pair in the input buffer. /// This method is called again before the method has read all the replacement string characters. /// The value of is less than U+D800 or greater than U+D8FF.-or-The value of is less than U+DC00 or greater than U+DFFF. /// 1 // Token: 0x06003743 RID: 14147 RVA: 0x000BCF50 File Offset: 0x000BB150 public override bool Fallback(char charUnknownHigh, char charUnknownLow, int index) { return this.Fallback(index); } // Token: 0x06003744 RID: 14148 RVA: 0x000BCF5C File Offset: 0x000BB15C private bool Fallback(int index) { if (this.fallback_assigned && this.Remaining != 0) { throw new ArgumentException("Reentrant Fallback method invocation occured. It might be because either this FallbackBuffer is incorrectly shared by multiple threads, invoked inside Encoding recursively, or Reset invocation is forgotten."); } if (index < 0) { throw new ArgumentOutOfRangeException("index"); } this.fallback_assigned = true; this.current = 0; return this.replacement.Length > 0; } /// Retrieves the next character in the replacement fallback buffer. /// The next Unicode character in the replacement fallback buffer that the application can encode. /// 2 // Token: 0x06003745 RID: 14149 RVA: 0x000BCFB8 File Offset: 0x000BB1B8 public override char GetNextChar() { if (this.current >= this.replacement.Length) { return '\0'; } return this.replacement[this.current++]; } /// Causes the next call to the method to access the character position in the replacement fallback buffer prior to the current character position. /// true if the operation was successful; otherwise, false. /// 1 // Token: 0x06003746 RID: 14150 RVA: 0x000BCFFC File Offset: 0x000BB1FC public override bool MovePrevious() { if (this.current == 0) { return false; } this.current--; return true; } /// Initializes all internal state information and data in this instance of . /// 1 // Token: 0x06003747 RID: 14151 RVA: 0x000BD01C File Offset: 0x000BB21C public override void Reset() { this.current = 0; } // Token: 0x04001681 RID: 5761 private string replacement; // Token: 0x04001682 RID: 5762 private int current; // Token: 0x04001683 RID: 5763 private bool fallback_assigned; } }