/// <summary> /// Add image to builder using <see cref="Plugin.Toast.IOS.IPlatformSpecificExtension.AddAttachment(UserNotifications.UNNotificationAttachment)"/> /// <seealso cref="IToastImageSourceFactory"/> /// </summary> public static T AddAttachment <T>(this T extension, ToastImageSource imageSource) where T : IBuilderExtension <T>, IIosNotificationExtension { return(extension.PrivateAddAttachment(imageSource)); }
#pragma warning restore CS1574 // XML comment has cref attribute that could not be resolved static T PrivateAddAttachment <T>(this T extension, ToastImageSource imageSource) where T : IBuilderExtension <T> { return(extension.Add(imageSource, Router.Route.IosSingleAttachment)); }
/// <summary> /// Add a image to builder using <see cref="Plugin.Toast.Droid.IPlatformSpecificExtension.SetLargeIcon(Android.Graphics.Bitmap)"/> /// <seealso cref="IToastImageSourceFactory"/> /// </summary> public static T AddLargeIcon <T>(this T extension, ToastImageSource imageSource) where T : IBuilderExtension <T>, IDroidNotificationExtension { return(extension.PrivateAddLargeIcon(imageSource)); }
static T PrivateAddLargeIcon <T>(this T extension, ToastImageSource imageSource) where T : IBuilderExtension <T> { return(extension.Add(imageSource, Router.Route.DroidLargeIcon)); }
#pragma warning disable CS1574 // XML comment has cref attribute that could not be resolved /// <summary> /// Add a image to builder. /// </summary> /// <remarks> /// Image routed to <see cref="Plugin.Toast.Droid.IPlatformSpecificExtension.SetLargeIcon(Android.Graphics.Bitmap)"/> /// or <see cref="Plugin.Toast.IOS.IPlatformSpecificExtension.AddAttachment(UserNotifications.UNNotificationAttachment)"/> /// or <see cref="IUwpExtension.AddAppLogoOverride(Uri, ToastGenericAppLogoCrop?, string?, bool?)"/>. If there a /// <see cref="ISnackbarExtension"/> or <see cref="IIosLocalNotificationExtension"/> then no action will performed. /// <seealso cref="IToastImageSourceFactory"/> /// </remarks> public static IBuilder AddImage(this IBuilder builder, ToastImageSource imageSource) => builder.Add(imageSource, Router.Route.Default);
/// <summary> /// Add a image to builder. /// </summary> /// <remarks> /// Image routed to <see cref="Plugin.Toast.Droid.IPlatformSpecificExtension.SetLargeIcon(Android.Graphics.Bitmap)"/> /// or <see cref="Plugin.Toast.IOS.IPlatformSpecificExtension.AddAttachment(UserNotifications.UNNotificationAttachment)"/> /// or <see cref="IUwpExtension.AddAppLogoOverride(Uri, ToastGenericAppLogoCrop?, string?, bool?)"/>. If there a /// <see cref="ISnackbarExtension"/> or <see cref="IIosLocalNotificationExtension"/> then no action will performed. /// <seealso cref="IToastImageSourceFactory"/> /// </remarks> public static T AddImage <T>(this T builder, ToastImageSource imageSource) where T : IBuilderExtension <T> { return(builder.Add(imageSource, Router.Route.Default)); }
/// <summary> /// Add a hero image to the toast. <seealso cref="IUwpExtension.AddHeroImage(Uri, string?, bool?)"/> /// <seealso cref="IToastImageSourceFactory"/> /// </summary> /// <param name="extension">Target extension.</param> /// <param name="imageSource">Image to add.</param> /// <param name="alternateText">A description of the image, for users of assistive technologies.</param> /// <param name="addImageQuery">A value whether Windows is allowed to append a query string to the image URI supplied in the Tile notification.</param> /// <returns></returns> public static IUwpExtension AddHeroImage(this IUwpExtension extension, ToastImageSource imageSource, string?alternateText = null, bool?addImageQuery = null) => PlatformAddHeroImage(extension, imageSource, alternateText, addImageQuery);
/// <summary> /// Add an image inline with other toast content. <seealso cref="IUwpExtension.AddInlineImage(Uri, string?, bool?, AdaptiveImageCrop?, bool?)"/> /// <seealso cref="IToastImageSourceFactory"/> /// </summary> /// <param name="extension">Target extension.</param> /// <param name="imageSource">Image to add.</param> /// <param name="alternateText">A description of the image, for users of assistive technologies.</param> /// <param name="addImageQuery">A value whether Windows is allowed to append a query string to the image URI supplied in the Tile notification.</param> /// <param name="hintCrop">A value whether a margin is removed. images have an 8px margin around them.</param> /// <param name="hintRemoveMargin">the horizontal alignment of the image.This is only supported when inside an <see cref="AdaptiveSubgroup"/>.</param> public static IUwpExtension AddInlineImage(this IUwpExtension extension, ToastImageSource imageSource, string?alternateText = null, bool?addImageQuery = null, AdaptiveImageCrop?hintCrop = null, bool?hintRemoveMargin = null) => PlatformAddInlineImage(extension, imageSource, alternateText, addImageQuery, hintCrop, hintRemoveMargin);
static IUwpExtension PlatformAddInlineImage(this IUwpExtension extension, ToastImageSource imageSource, string?alternateText, bool?addImageQuery, AdaptiveImageCrop?hintCrop, bool?hintRemoveMargin) => extension.AddInlineImage(imageSource.ImageUri, alternateText, addImageQuery, hintCrop, hintRemoveMargin);
/// <summary> /// Override the app logo with custom image of choice that will be displayed on the toast. /// <seealso cref="IUwpExtension.AddAppLogoOverride(Uri, ToastGenericAppLogoCrop?, string?, bool?)"/> /// <seealso cref="IToastImageSourceFactory"/> /// </summary> /// <param name="extension">Target extension.</param> /// <param name="imageSource">Image to add.</param> /// <param name="hintCrop">Specify how the image should be cropped.</param> /// <param name="alternateText">A description of the image, for users of assistive technologies.</param> /// <param name="addImageQuery">A value whether Windows is allowed to append a query string to the image URI supplied in the Tile notification.</param> public static IUwpExtension AddAppLogoOverride(this IUwpExtension extension, ToastImageSource imageSource, ToastGenericAppLogoCrop?hintCrop = null, string?alternateText = null, bool?addImageQuery = null) => PlatformAddAppLogoOverride(extension, imageSource, hintCrop, alternateText, addImageQuery);
static IUwpExtension PlatformAddHeroImage(this IUwpExtension extension, ToastImageSource imageSource, string?alternateText, bool?addImageQuery) => extension.AddHeroImage(imageSource.ImageUri, alternateText, addImageQuery);
static IUwpExtension PlatformAddAppLogoOverride(this IUwpExtension extension, ToastImageSource imageSource, ToastGenericAppLogoCrop?hintCrop, string?alternateText, bool?addImageQuery) => extension.AddAppLogoOverride(imageSource.ImageUri, hintCrop, alternateText, addImageQuery);
static IUwpExtension PlatformAddInlineImage(this IUwpExtension extension, ToastImageSource imageSource, string?alternateText, bool?addImageQuery, AdaptiveImageCrop?hintCrop, bool?hintRemoveMargin) => throw ExceptionUtils.NotSupportedOrImplementedException;
static IUwpExtension PlatformAddHeroImage(this IUwpExtension extension, ToastImageSource imageSource, string?alternateText, bool?addImageQuery) => throw ExceptionUtils.NotSupportedOrImplementedException;
static IUwpExtension PlatformAddAppLogoOverride(this IUwpExtension extension, ToastImageSource imageSource, ToastGenericAppLogoCrop?hintCrop, string?alternateText, bool?addImageQuery) => throw ExceptionUtils.NotSupportedOrImplementedException;