/// <summary> /// Returns a handle in the same directory with the same stem, but with the given extension. If not found, returns <see langword="null"/>. /// </summary> /// <param name="this"></param> /// <param name="extension">The extension, which should NOT have a leading '.', of the handle to retrieve</param> public static IChildHandle?WithExtension(this IChildHandle @this, string extension) { return(@this.WithName($"{@this.GetStem()}.{extension}")); }
/// <summary> /// Returns a handle in the same directory with the same extension, but with the given stem. If not found, returns <see langword="null"/>. /// </summary> /// <param name="this"></param> /// <param name="stem">The stem of the handle to retrieve</param> public static IChildHandle?WithStem(this IChildHandle @this, string stem) { return(@this.WithName($"{stem}.{@this.GetExtension()}")); }