Microsoft.Cci.SourceDocumentWithInclusion.GetPrimarySourceLocation C# (CSharp) Method

GetPrimarySourceLocation() public method

Obtains a source location instance that corresponds to the substring of the document specified by the given start position and length.
public GetPrimarySourceLocation ( int position, int length ) : IPrimarySourceLocation
position int
length int
return IPrimarySourceLocation
    public IPrimarySourceLocation GetPrimarySourceLocation(int position, int length)
      //^^ requires 0 <= position && (position < this.Length || position == 0);
      //^^ requires 0 <= length;
      //^^ requires length <= this.Length;
      //^^ requires position+length <= this.Length;
      //^^ ensures result.SourceDocument == this;
      //^^ ensures result.StartIndex == position;
      //^^ ensures result.Length == length;
    {
      return new IncludedSourceLocation(this, position, length);
    }