diff --git a/README.md b/README.md index afe9b873..0b37067f 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ And then use it in Razor file ([for example](https://github.com/CropperBlazor/Cr IsErrorLoadImage="@IsErrorLoadImage" OnErrorLoadImageEvent="OnErrorLoadImageEvent" Options="Options" - IsAvaibleInitCropper="IsAvaibleInitCropper"> + IsAvailableInitCropper="IsAvailableInitCropper"> ``` diff --git a/src/Cropper.Blazor/Client/Pages/CropperDemo.razor b/src/Cropper.Blazor/Client/Pages/CropperDemo.razor index 43231c15..6ded163a 100644 --- a/src/Cropper.Blazor/Client/Pages/CropperDemo.razor +++ b/src/Cropper.Blazor/Client/Pages/CropperDemo.razor @@ -35,7 +35,7 @@ IsErrorLoadImage="@IsErrorLoadImage" OnErrorLoadImageEvent="OnErrorLoadImageEvent" Options="Options" - IsAvaibleInitCropper="IsAvaibleInitCropper" /> + IsAvailableInitCropper="IsAvailableInitCropper" /> diff --git a/src/Cropper.Blazor/Client/Pages/CropperDemo.razor.cs b/src/Cropper.Blazor/Client/Pages/CropperDemo.razor.cs index 17ba0eec..7964c212 100644 --- a/src/Cropper.Blazor/Client/Pages/CropperDemo.razor.cs +++ b/src/Cropper.Blazor/Client/Pages/CropperDemo.razor.cs @@ -1,4 +1,6 @@ -using Cropper.Blazor.Client.Components; +using System.Reflection; +using System.Text.Json; +using Cropper.Blazor.Client.Components; using Cropper.Blazor.Client.Enums; using Cropper.Blazor.Components; using Cropper.Blazor.Events; @@ -14,8 +16,6 @@ using Microsoft.JSInterop; using MudBlazor; using MudBlazor.Services; -using System.Reflection; -using System.Text.Json; using ErrorEventArgs = Microsoft.AspNetCore.Components.Web.ErrorEventArgs; namespace Cropper.Blazor.Client.Pages @@ -38,7 +38,7 @@ public partial class CropperDemo : IDisposable private string Src = "https://fengyuanchen.github.io/cropperjs/v2/picture.jpg"; private bool IsErrorLoadImage { get; set; } = false; - private bool IsAvaibleInitCropper { get; set; } = true; + private bool IsAvailableInitCropper { get; set; } = true; private readonly string _errorLoadImageSrc = "not-found-image.jpg"; private Breakpoint Start; private Guid SubscriptionId; @@ -392,7 +392,7 @@ public async Task InputFileChangeAsync(InputFileChangeEventArgs inputFileChangeE Src = await CropperComponent!.GetImageUsingStreamingAsync(imageFile, imageFile.Size); - IsAvaibleInitCropper = true; + IsAvailableInitCropper = true; IsErrorLoadImage = false; CropperComponent?.Destroy(); @@ -411,12 +411,12 @@ public async Task ReplaceImageAsync(InputFileChangeEventArgs inputFileChangeEven if (IsErrorLoadImage) { - IsAvaibleInitCropper = true; + IsAvailableInitCropper = true; IsErrorLoadImage = false; } else { - IsAvaibleInitCropper = false; + IsAvailableInitCropper = false; } CropperComponent?.ReplaceAsync(src); diff --git a/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Components/CropperComponent_Should.cs b/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Components/CropperComponent_Should.cs index e5cc633d..b8a90f42 100644 --- a/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Components/CropperComponent_Should.cs +++ b/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Components/CropperComponent_Should.cs @@ -272,8 +272,8 @@ public async Task Should_Render_CropperComponent_SuccessfulAsync() ComponentParameter isErrorLoadImageParameter = ComponentParameter.CreateParameter( nameof(CropperComponent.IsErrorLoadImage), false); - ComponentParameter isAvaibleInitCropperParameter = ComponentParameter.CreateParameter( - nameof(CropperComponent.IsAvaibleInitCropper), + ComponentParameter isAvailableInitCropperParameter = ComponentParameter.CreateParameter( + nameof(CropperComponent.IsAvailableInitCropper), true); ComponentParameter onLoadImageParameter = ComponentParameter.CreateParameter( nameof(CropperComponent.OnLoadImageEvent), @@ -347,7 +347,7 @@ public async Task Should_Render_CropperComponent_SuccessfulAsync() loadingParameter, errorLoadImageSrcParameter, isErrorLoadImageParameter, - isAvaibleInitCropperParameter, + isAvailableInitCropperParameter, srcParameter, imageClassParameter, onLoadImageParameter, @@ -597,8 +597,8 @@ public void Should_Not_Render_CropperComponent_With_IsNotAvaibleInitCropper_Para ComponentParameter isErrorLoadImage = ComponentParameter.CreateParameter( nameof(CropperComponent.IsErrorLoadImage), true); - ComponentParameter isAvaibleInitCropperParameter = ComponentParameter.CreateParameter( - nameof(CropperComponent.IsAvaibleInitCropper), + ComponentParameter isAvailableInitCropperParameter = ComponentParameter.CreateParameter( + nameof(CropperComponent.IsAvailableInitCropper), false); // act @@ -608,7 +608,7 @@ public void Should_Not_Render_CropperComponent_With_IsNotAvaibleInitCropper_Para loadingParameter, errorLoadImageSrcParameter, isErrorLoadImage, - isAvaibleInitCropperParameter); + isAvailableInitCropperParameter); // assert IElement expectedElement = cropperComponent.Find($"img.{errorLoadImageClass}"); diff --git a/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/CropEndEvent/CropEndEvent_Should.cs b/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/CropEndEvent/CropEndEvent_Should.cs index 69d48e69..1f0b5efc 100644 --- a/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/CropEndEvent/CropEndEvent_Should.cs +++ b/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/CropEndEvent/CropEndEvent_Should.cs @@ -1,4 +1,5 @@ -using Bogus; +using System.Collections.Generic; +using Bogus; using Microsoft.JSInterop; using Moq; using Xunit; @@ -8,24 +9,37 @@ namespace Cropper.Blazor.UnitTests.Events.CropEndEvent { public class CropEndEvent_Should { - private readonly Mock _mockIJSObjectReference; - private readonly Event _event; + private static Mock _mockIJSObjectReference = null!; - public CropEndEvent_Should() + [Theory, MemberData(nameof(TestData_Verify_Dispose))] + public void Verify_Dispose(IJSObjectReference? jSObjectReference, Times times) { - _mockIJSObjectReference = new Mock(); - _event = new Faker() - .RuleFor(x => x.OriginalEvent, _mockIJSObjectReference.Object); - } + // arrange + Event @event = new Faker() + .RuleFor(x => x.OriginalEvent, jSObjectReference); - [Fact] - public void Verify_Dispose() - { // act - _event.Dispose(); + @event.Dispose(); // assert - _mockIJSObjectReference.Verify(c => c.DisposeAsync(), Times.Once()); + _mockIJSObjectReference.Verify(c => c.DisposeAsync(), times); + } + + public static IEnumerable TestData_Verify_Dispose() + { + yield return WrapArgs(null, Times.Never()); + + _mockIJSObjectReference = new Mock(); + yield return WrapArgs(_mockIJSObjectReference.Object, Times.Once()); + + static object[] WrapArgs( + IJSObjectReference? jSObjectReference, + Times times) + => new object[] + { + jSObjectReference, + times + }; } } } diff --git a/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/CropMoveEvent/CropMoveEvent_Should.cs b/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/CropMoveEvent/CropMoveEvent_Should.cs index 2d84321a..79cc67cd 100644 --- a/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/CropMoveEvent/CropMoveEvent_Should.cs +++ b/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/CropMoveEvent/CropMoveEvent_Should.cs @@ -1,4 +1,5 @@ -using Bogus; +using System.Collections.Generic; +using Bogus; using Microsoft.JSInterop; using Moq; using Xunit; @@ -8,24 +9,37 @@ namespace Cropper.Blazor.UnitTests.Events.CropMoveEvent { public class CropMoveEvent_Should { - private readonly Mock _mockIJSObjectReference; - private readonly Event _event; + private static Mock _mockIJSObjectReference = null!; - public CropMoveEvent_Should() + [Theory, MemberData(nameof(TestData_Verify_Dispose))] + public void Verify_Dispose(IJSObjectReference? jSObjectReference, Times times) { - _mockIJSObjectReference = new Mock(); - _event = new Faker() - .RuleFor(x => x.OriginalEvent, _mockIJSObjectReference.Object); - } + // arrange + Event @event = new Faker() + .RuleFor(x => x.OriginalEvent, jSObjectReference); - [Fact] - public void Verify_Dispose() - { // act - _event.Dispose(); + @event.Dispose(); // assert - _mockIJSObjectReference.Verify(c => c.DisposeAsync(), Times.Once()); + _mockIJSObjectReference.Verify(c => c.DisposeAsync(), times); + } + + public static IEnumerable TestData_Verify_Dispose() + { + yield return WrapArgs(null, Times.Never()); + + _mockIJSObjectReference = new Mock(); + yield return WrapArgs(_mockIJSObjectReference.Object, Times.Once()); + + static object[] WrapArgs( + IJSObjectReference? jSObjectReference, + Times times) + => new object[] + { + jSObjectReference, + times + }; } } } diff --git a/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/CropStartEvent/CropStartEvent_Should.cs b/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/CropStartEvent/CropStartEvent_Should.cs index 70d8d8c0..47471089 100644 --- a/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/CropStartEvent/CropStartEvent_Should.cs +++ b/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/CropStartEvent/CropStartEvent_Should.cs @@ -1,4 +1,5 @@ -using Bogus; +using System.Collections.Generic; +using Bogus; using Microsoft.JSInterop; using Moq; using Xunit; @@ -8,24 +9,37 @@ namespace Cropper.Blazor.UnitTests.Events.CropStartEvent { public class CropStartEvent_Should { - private readonly Mock _mockIJSObjectReference; - private readonly Event _event; + private static Mock _mockIJSObjectReference = null!; - public CropStartEvent_Should() + [Theory, MemberData(nameof(TestData_Verify_Dispose))] + public void Verify_Dispose(IJSObjectReference? jSObjectReference, Times times) { - _mockIJSObjectReference = new Mock(); - _event = new Faker() - .RuleFor(x => x.OriginalEvent, _mockIJSObjectReference.Object); - } + // arrange + Event @event = new Faker() + .RuleFor(x => x.OriginalEvent, jSObjectReference); - [Fact] - public void Verify_Dispose() - { // act - _event.Dispose(); + @event.Dispose(); // assert - _mockIJSObjectReference.Verify(c => c.DisposeAsync(), Times.Once()); + _mockIJSObjectReference.Verify(c => c.DisposeAsync(), times); + } + + public static IEnumerable TestData_Verify_Dispose() + { + yield return WrapArgs(null, Times.Never()); + + _mockIJSObjectReference = new Mock(); + yield return WrapArgs(_mockIJSObjectReference.Object, Times.Once()); + + static object[] WrapArgs( + IJSObjectReference? jSObjectReference, + Times times) + => new object[] + { + jSObjectReference, + times + }; } } } diff --git a/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/ZoomEvent/ZoomEvent_Should.cs b/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/ZoomEvent/ZoomEvent_Should.cs index d2328ee9..e79499b5 100644 --- a/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/ZoomEvent/ZoomEvent_Should.cs +++ b/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Events/ZoomEvent/ZoomEvent_Should.cs @@ -1,4 +1,5 @@ -using Bogus; +using System.Collections.Generic; +using Bogus; using Microsoft.JSInterop; using Moq; using Xunit; @@ -8,24 +9,37 @@ namespace Cropper.Blazor.UnitTests.Events.ZoomEvent { public class ZoomEvent_Should { - private readonly Mock _mockIJSObjectReference; - private readonly Event _event; + private static Mock _mockIJSObjectReference = null!; - public ZoomEvent_Should() + [Theory, MemberData(nameof(TestData_Verify_Dispose))] + public void Verify_Dispose(IJSObjectReference? jSObjectReference, Times times) { - _mockIJSObjectReference = new Mock(); - _event = new Faker() - .RuleFor(x => x.OriginalEvent, _mockIJSObjectReference.Object); - } + // arrange + Event @event = new Faker() + .RuleFor(x => x.OriginalEvent, jSObjectReference); - [Fact] - public void Verify_Dispose() - { // act - _event.Dispose(); + @event.Dispose(); // assert - _mockIJSObjectReference.Verify(c => c.DisposeAsync(), Times.Once()); + _mockIJSObjectReference.Verify(c => c.DisposeAsync(), times); + } + + public static IEnumerable TestData_Verify_Dispose() + { + yield return WrapArgs(null, Times.Never()); + + _mockIJSObjectReference = new Mock(); + yield return WrapArgs(_mockIJSObjectReference.Object, Times.Once()); + + static object[] WrapArgs( + IJSObjectReference? jSObjectReference, + Times times) + => new object[] + { + jSObjectReference, + times + }; } } } diff --git a/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Models/CroppedCanvas_Should.cs b/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Models/CroppedCanvas_Should.cs index 1a2143ab..041d4525 100644 --- a/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Models/CroppedCanvas_Should.cs +++ b/src/Cropper.Blazor/Cropper.Blazor.UnitTests/Models/CroppedCanvas_Should.cs @@ -1,4 +1,5 @@ -using Bogus; +using System.Collections.Generic; +using Bogus; using Cropper.Blazor.Models; using Microsoft.JSInterop; using Moq; @@ -8,24 +9,37 @@ namespace Cropper.Blazor.UnitTests.Models { public class CroppedCanvas_Should { - private readonly Mock _mockIJSObjectReference; - private readonly CroppedCanvas _croppedCanvas; + private static Mock _mockIJSObjectReference = null!; - public CroppedCanvas_Should() + [Theory, MemberData(nameof(TestData_Verify_Dispose))] + public void Verify_Dispose(IJSObjectReference? jSObjectReference, Times times) { - _mockIJSObjectReference = new Mock(); - _croppedCanvas = new Faker() - .CustomInstantiator(f => new CroppedCanvas(_mockIJSObjectReference.Object)); - } + // arrange + CroppedCanvas croppedCanvas = new Faker() + .CustomInstantiator(f => new CroppedCanvas(jSObjectReference)); - [Fact] - public void Verify_Dispose() - { // act - _croppedCanvas.Dispose(); + croppedCanvas.Dispose(); // assert - _mockIJSObjectReference.Verify(c => c.DisposeAsync(), Times.Once()); + _mockIJSObjectReference.Verify(c => c.DisposeAsync(), times); + } + + public static IEnumerable TestData_Verify_Dispose() + { + yield return WrapArgs(null, Times.Never()); + + _mockIJSObjectReference = new Mock(); + yield return WrapArgs(_mockIJSObjectReference.Object, Times.Once()); + + static object[] WrapArgs( + IJSObjectReference? jSObjectReference, + Times times) + => new object[] + { + jSObjectReference, + times + }; } } } diff --git a/src/Cropper.Blazor/Cropper.Blazor/Components/CropperComponent.razor.cs b/src/Cropper.Blazor/Cropper.Blazor/Components/CropperComponent.razor.cs index b6808d58..4d186fd0 100644 --- a/src/Cropper.Blazor/Cropper.Blazor/Components/CropperComponent.razor.cs +++ b/src/Cropper.Blazor/Cropper.Blazor/Components/CropperComponent.razor.cs @@ -72,7 +72,7 @@ public partial class CropperComponent : ICropperComponentBase, IAsyncDisposable, /// In addition, it should be used to disable re-initialization (replace image) of cropper after successful image load when set to false. /// [Parameter] - public bool IsAvaibleInitCropper { get; set; } = true; + public bool IsAvailableInitCropper { get; set; } = true; /// /// User class names, separated by space. @@ -177,7 +177,7 @@ protected override void OnInitialized() /// private void OnLoadImage(ProgressEventArgs progressEventArgs) { - if (IsAvaibleInitCropper) + if (IsAvailableInitCropper) { InitCropper(); } @@ -270,7 +270,7 @@ public void IsReady(JSEventData jSEventData) /// The used to propagate notifications that the operation should be canceled. public void SetDragMode(DragMode dragMode, CancellationToken cancellationToken = default) { - CropperJsIntertop?.SetDragModeAsync(CropperComponentId, dragMode, cancellationToken); + CropperJsIntertop!.SetDragModeAsync(CropperComponentId, dragMode, cancellationToken); } /// @@ -284,7 +284,7 @@ public void SetDragMode(DragMode dragMode, CancellationToken cancellationToken = /// The used to propagate notifications that the operation should be canceled. public void Zoom(decimal ratio, CancellationToken cancellationToken = default) { - CropperJsIntertop?.ZoomAsync(CropperComponentId, ratio, cancellationToken); + CropperJsIntertop!.ZoomAsync(CropperComponentId, ratio, cancellationToken); } /// @@ -296,7 +296,7 @@ public void Zoom(decimal ratio, CancellationToken cancellationToken = default) /// The used to propagate notifications that the operation should be canceled. public void ZoomTo(decimal ratio, decimal pivotX, decimal pivotY, CancellationToken cancellationToken = default) { - CropperJsIntertop?.ZoomToAsync(CropperComponentId, ratio, pivotX, pivotY, cancellationToken); + CropperJsIntertop!.ZoomToAsync(CropperComponentId, ratio, pivotX, pivotY, cancellationToken); } /// @@ -307,7 +307,7 @@ public void ZoomTo(decimal ratio, decimal pivotX, decimal pivotY, CancellationTo /// The used to propagate notifications that the operation should be canceled. public void Move(decimal offsetX, decimal? offsetY, CancellationToken cancellationToken = default) { - CropperJsIntertop?.MoveAsync(CropperComponentId, offsetX, offsetY, cancellationToken); + CropperJsIntertop!.MoveAsync(CropperComponentId, offsetX, offsetY, cancellationToken); } /// @@ -318,7 +318,7 @@ public void Move(decimal offsetX, decimal? offsetY, CancellationToken cancellati /// The used to propagate notifications that the operation should be canceled. public void MoveTo(decimal x, decimal? y, CancellationToken cancellationToken = default) { - CropperJsIntertop?.MoveToAsync(CropperComponentId, x, y, cancellationToken); + CropperJsIntertop!.MoveToAsync(CropperComponentId, x, y, cancellationToken); } /// @@ -332,7 +332,7 @@ public void MoveTo(decimal x, decimal? y, CancellationToken cancellationToken = /// The used to propagate notifications that the operation should be canceled. public void Rotate(decimal degree, CancellationToken cancellationToken = default) { - CropperJsIntertop?.RotateAsync(CropperComponentId, degree, cancellationToken); + CropperJsIntertop!.RotateAsync(CropperComponentId, degree, cancellationToken); } /// @@ -346,7 +346,7 @@ public void Rotate(decimal degree, CancellationToken cancellationToken = default /// The used to propagate notifications that the operation should be canceled. public void ScaleX(decimal scaleX, CancellationToken cancellationToken = default) { - CropperJsIntertop?.ScaleXAsync(CropperComponentId, scaleX, cancellationToken); + CropperJsIntertop!.ScaleXAsync(CropperComponentId, scaleX, cancellationToken); } /// @@ -360,7 +360,7 @@ public void ScaleX(decimal scaleX, CancellationToken cancellationToken = default /// The used to propagate notifications that the operation should be canceled. public void ScaleY(decimal scaleY, CancellationToken cancellationToken = default) { - CropperJsIntertop?.ScaleYAsync(CropperComponentId, scaleY, cancellationToken); + CropperJsIntertop!.ScaleYAsync(CropperComponentId, scaleY, cancellationToken); } /// @@ -379,7 +379,7 @@ public void ScaleY(decimal scaleY, CancellationToken cancellationToken = default /// The used to propagate notifications that the operation should be canceled. public void Scale(decimal scaleX, decimal scaleY, CancellationToken cancellationToken = default) { - CropperJsIntertop?.ScaleAsync(CropperComponentId, scaleX, scaleY, cancellationToken); + CropperJsIntertop!.ScaleAsync(CropperComponentId, scaleX, scaleY, cancellationToken); } /// @@ -388,7 +388,7 @@ public void Scale(decimal scaleX, decimal scaleY, CancellationToken cancellation /// The used to propagate notifications that the operation should be canceled. public void Crop(CancellationToken cancellationToken = default) { - CropperJsIntertop?.CropAsync(CropperComponentId, cancellationToken); + CropperJsIntertop!.CropAsync(CropperComponentId, cancellationToken); } /// @@ -397,7 +397,7 @@ public void Crop(CancellationToken cancellationToken = default) /// The used to propagate notifications that the operation should be canceled. public void Clear(CancellationToken cancellationToken = default) { - CropperJsIntertop?.ClearAsync(CropperComponentId, cancellationToken); + CropperJsIntertop!.ClearAsync(CropperComponentId, cancellationToken); } /// @@ -406,7 +406,7 @@ public void Clear(CancellationToken cancellationToken = default) /// The used to propagate notifications that the operation should be canceled. public void Enable(CancellationToken cancellationToken = default) { - CropperJsIntertop?.EnableAsync(CropperComponentId, cancellationToken); + CropperJsIntertop!.EnableAsync(CropperComponentId, cancellationToken); } /// @@ -415,7 +415,7 @@ public void Enable(CancellationToken cancellationToken = default) /// The used to propagate notifications that the operation should be canceled. public void Disable(CancellationToken cancellationToken = default) { - CropperJsIntertop?.DisableAsync(CropperComponentId, cancellationToken); + CropperJsIntertop!.DisableAsync(CropperComponentId, cancellationToken); } /// @@ -424,7 +424,7 @@ public void Disable(CancellationToken cancellationToken = default) /// The used to propagate notifications that the operation should be canceled. public void Reset(CancellationToken cancellationToken = default) { - CropperJsIntertop?.ResetAsync(CropperComponentId, cancellationToken); + CropperJsIntertop!.ResetAsync(CropperComponentId, cancellationToken); } /// @@ -433,7 +433,7 @@ public void Reset(CancellationToken cancellationToken = default) /// The used to propagate notifications that the operation should be canceled. public void Destroy(CancellationToken cancellationToken = default) { - CropperJsIntertop?.DestroyAsync(CropperComponentId, cancellationToken); + CropperJsIntertop!.DestroyAsync(CropperComponentId, cancellationToken); } /// @@ -443,7 +443,7 @@ public void Destroy(CancellationToken cancellationToken = default) /// The used to propagate notifications that the operation should be canceled. public void SetAspectRatio(decimal aspectRatio, CancellationToken cancellationToken = default) { - CropperJsIntertop?.SetAspectRatioAsync(CropperComponentId, aspectRatio, cancellationToken); + CropperJsIntertop!.SetAspectRatioAsync(CropperComponentId, aspectRatio, cancellationToken); } /// @@ -453,7 +453,7 @@ public void SetAspectRatio(decimal aspectRatio, CancellationToken cancellationTo /// The used to propagate notifications that the operation should be canceled. public void SetCropBoxData(SetCropBoxDataOptions cropBoxDataOptions, CancellationToken cancellationToken = default) { - CropperJsIntertop?.SetCropBoxDataAsync(CropperComponentId, cropBoxDataOptions, cancellationToken); + CropperJsIntertop!.SetCropBoxDataAsync(CropperComponentId, cropBoxDataOptions, cancellationToken); } /// @@ -463,7 +463,7 @@ public void SetCropBoxData(SetCropBoxDataOptions cropBoxDataOptions, Cancellatio /// The used to propagate notifications that the operation should be canceled. public void SetData(SetDataOptions setDataOptions, CancellationToken cancellationToken = default) { - CropperJsIntertop?.SetDataAsync(CropperComponentId, setDataOptions, cancellationToken); + CropperJsIntertop!.SetDataAsync(CropperComponentId, setDataOptions, cancellationToken); } /// @@ -473,7 +473,7 @@ public void SetData(SetDataOptions setDataOptions, CancellationToken cancellatio /// The used to propagate notifications that the operation should be canceled. public void SetCanvasData(SetCanvasDataOptions setCanvasDataOptions, CancellationToken cancellationToken = default) { - CropperJsIntertop?.SetCanvasDataAsync(CropperComponentId, setCanvasDataOptions, cancellationToken); + CropperJsIntertop!.SetCanvasDataAsync(CropperComponentId, setCanvasDataOptions, cancellationToken); } ///