Microsoft.Cci.CompositeSourceDocument.GetDerivedSourceLocation C# (CSharp) Method

GetDerivedSourceLocation() public method

Obtains a source location instance that corresponds to the substring of the document specified by the given start position and length.
public GetDerivedSourceLocation ( int position, int length ) : IDerivedSourceLocation
position int
length int
return IDerivedSourceLocation
    public IDerivedSourceLocation GetDerivedSourceLocation(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;
    {
      IDerivedSourceLocation result = new DerivedSourceLocation(this, position, length);
      //^ assume result.SourceDocument == this;
      //^ assume result.StartIndex == position;
      //^ assume result.Length == length;
      return result;
    }