Exemple #1
0
 public IEnumerable <T> WalkWith <T>(PathSegmentTranslator <T> translator)
 {
     return(this.segments.Select(segment => segment.Translate(translator)));
 }
Exemple #2
0
 /// <summary>
 /// Translate a <exception cref="ValueSegment"> into another object using an instance of</exception> <see cref="PathSegmentTranslator{T}"/>.
 /// </summary>
 /// <typeparam name="T">Type that the translator will return after visiting this token.</typeparam>
 /// <param name="translator">An implementation of the translator interface.</param>
 /// <returns>An object whose type is determined by the type parameter of the translator.</returns>
 /// <exception cref="System.ArgumentNullException">Throws if the input translator is null.</exception>
 public override T Translate <T>(PathSegmentTranslator <T> translator)
 {
     ExceptionUtils.CheckArgumentNotNull(translator, "translator");
     return(translator.Translate(this));
 }
Exemple #3
0
 /// <summary>
 /// Translate a <see cref="ODataPathSegment"/> using an implemntation of<see cref="PathSegmentTranslator{T}"/>.
 /// </summary>
 /// <typeparam name="T">Type that the translator will return after visiting this token.</typeparam>
 /// <param name="translator">An implementation of the translator interface.</param>
 /// <returns>An object whose type is determined by the type parameter of the translator.</returns>
 public abstract T Translate <T>(PathSegmentTranslator <T> translator);