/// <summary> /// 使用指定的字符读取器、起始位置和 Tab 宽度初始化 <see cref="SourceReader"/> 类的新实例。 /// </summary> /// <param name="reader">用于读取源文件的字符读取器。</param> /// <param name="initPosition">起始位置。</param> /// <param name="tabSize">Tab 的宽度。</param> /// <exception cref="ArgumentNullException"><paramref name="reader"/> 为 <c>null</c>。</exception> /// <exception cref="ArgumentOutOfRangeException"><paramref name="tabSize"/> 小于等于 <c>0</c>。</exception> public SourceReader(TextReader reader, SourcePosition initPosition, int tabSize) : this(initPosition, tabSize) { CommonExceptions.CheckArgumentNull(reader, "reader"); if (tabSize <= 0) { throw CommonExceptions.ArgumentMustBePositive("tabSize", tabSize); } Contract.EndContractBlock(); this.reader = reader; }