return new EraInfo(0, year, month, day, year - 1, 1, 0,
names[0], names[1], names[3]);
}
-
- // PAL Layer ends here
-
- private static readonly string[] s_japaneseErasEnglishNames = new string[] { "M", "T", "S", "H", "R" };
-
- private static string GetJapaneseEnglishEraName(int era)
- {
- Debug.Assert(era > 0);
- return era <= s_japaneseErasEnglishNames.Length ? s_japaneseErasEnglishNames[era - 1] : " ";
- }
}
}
_disposed = true;
// Dispose of our resources if this StreamReader is closable.
- if (!LeaveOpen)
+ if (_closable)
{
try
{
get { return _stream; }
}
- internal bool LeaveOpen
- {
- get { return !_closable; }
- }
-
// DiscardBufferedData tells StreamReader to throw away its internal
// buffer contents. This is useful if the user needs to seek on the
// underlying stream to a known location then wants the StreamReader
private void CloseStreamFromDispose(bool disposing)
{
// Dispose of our resources if this StreamWriter is closable.
- if (!LeaveOpen && !_disposed)
+ if (_closable && !_disposed)
{
try
{
get { return _stream; }
}
- internal bool LeaveOpen
- {
- get { return !_closable; }
- }
-
- internal bool HaveWrittenPreamble
- {
- set { _haveWrittenPreamble = value; }
- }
-
public override Encoding Encoding
{
get { return _encoding; }
charPos = 0;
}
- _this.CharPos_Prop = charPos;
+ _this._charPos = charPos;
}
public override Task WriteAsync(string? value)
charPos = 0;
}
- _this.CharPos_Prop = charPos;
+ _this._charPos = charPos;
}
public override Task WriteAsync(char[] buffer, int index, int count)
charPos = 0;
}
- _this.CharPos_Prop = charPos;
+ _this._charPos = charPos;
}
public override Task WriteLineAsync()
return task;
}
- private int CharPos_Prop
- {
- set { _charPos = value; }
- }
-
- private bool HaveWrittenPreamble_Prop
- {
- set { _haveWrittenPreamble = value; }
- }
-
private Task FlushAsyncInternal(bool flushStream, bool flushEncoder,
char[] sCharBuffer, int sCharPos, CancellationToken cancellationToken = default)
{
{
if (!haveWrittenPreamble)
{
- _this.HaveWrittenPreamble_Prop = true;
+ _this._haveWrittenPreamble = true;
byte[] preamble = encoding.GetPreamble();
if (preamble.Length > 0)
{
return Parse(s, style, NumberFormatInfo.GetInstance(provider));
}
- private static sbyte Parse(string s, NumberStyles style, NumberFormatInfo info)
- {
- if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
- return Parse((ReadOnlySpan<char>)s, style, info);
- }
-
private static sbyte Parse(ReadOnlySpan<char> s, NumberStyles style, NumberFormatInfo info)
{
Number.ParsingStatus status = Number.TryParseInt32(s, style, info, out int i);