Пример #1
0
 public IEnumerable <T> WalkWith <T>(PathSegmentTranslator <T> translator)
 {
     return(this.segments.Select(segment => segment.TranslateWith(translator)));
 }
Пример #2
0
 /// <summary>
 /// Translate a <see cref="PropertySegment"/> using an instance 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>
 /// <exception cref="System.ArgumentNullException">Throws if the input translator is null.</exception>
 public override T TranslateWith <T>(PathSegmentTranslator <T> translator)
 {
     ExceptionUtils.CheckArgumentNotNull(translator, "translator");
     return(translator.Translate(this));
 }
Пример #3
0
 /// <summary>
 /// Translate a <see cref="ODataPathSegment"/> using an implementation 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 TranslateWith <T>(PathSegmentTranslator <T> translator);