-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat (Builders): image builder logic is now split into separate inter…
…faces This is to add with future extension methods creation.
- Loading branch information
1 parent
191d839
commit 5bd1d02
Showing
6 changed files
with
58 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/Rhythm.Drop.Builders/Images/IAddDimensionsImageBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Rhythm.Drop.Builders.Images; | ||
|
||
/// <summary> | ||
/// A contract for creating an image builder that can add dimensions. | ||
/// </summary> | ||
/// <typeparam name="TBuilder">The type of the builder to return after adding dimensions.</typeparam> | ||
public interface IAddDimensionsImageBuilder<TBuilder> | ||
{ | ||
/// <summary> | ||
/// Adds dimensions to the builder. | ||
/// </summary> | ||
/// <param name="width">The width.</param> | ||
/// <param name="height">The height.</param> | ||
/// <returns>A <typeparamref name="TBuilder"/>.</returns> | ||
TBuilder AddDimensions(int width, int height); | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Rhythm.Drop.Builders/Images/IAddImageSourcesImageBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace Rhythm.Drop.Builders.Images; | ||
|
||
using Rhythm.Drop.Models.Images; | ||
using System.Collections.Generic; | ||
|
||
/// <summary> | ||
/// A contract for creating an image builder that can add <see cref="IImageSource"/> objects. | ||
/// </summary> | ||
/// <typeparam name="TBuilder">The type of the builder to return after adding <see cref="IImageSource"/> objects.</typeparam> | ||
public interface IAddImageSourcesImageBuilder<TBuilder> | ||
{ | ||
/// <summary> | ||
/// Adds a source to the builder. | ||
/// </summary> | ||
/// <param name="source">The source.</param> | ||
/// <returns>A <typeparamref name="TBuilder"/>.</returns> | ||
TBuilder AddSource(IImageSource source); | ||
|
||
/// <summary> | ||
/// Adds multiple sources to the builder. | ||
/// </summary> | ||
/// <param name="sources">The sources.</param> | ||
/// <returns>A <typeparamref name="TBuilder"/>.</returns> | ||
TBuilder AddSources(IReadOnlyCollection<IImageSource> sources); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Rhythm.Drop.Builders.Images; | ||
|
||
/// <summary> | ||
/// A contract for creating an image builder that can add a URL. | ||
/// </summary> | ||
/// <typeparam name="TBuilder">The type of the builder to return after adding a URL.</typeparam> | ||
public interface IAndUrlImageBuilder<TBuilder> | ||
{ | ||
/// <summary> | ||
/// Adds a URL to the builder. | ||
/// </summary> | ||
/// <param name="url">The URL.</param> | ||
/// <returns>A <typeparamref name="TBuilder"/>.</returns> | ||
TBuilder AndUrl(string? url); | ||
} |