Example #1
0
        public async void Should_SetOptionsAsync()
        {
            var id        = "id";
            var animation = new DropAnimation(id, _jsRuntime.Object);
            var options   = new DropAnimationOptions();
            await animation.SetOptionsAsync(options);

            _jsRuntime.Verify(runtime => runtime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.SetOptions.ToAnimationNamespace(), id, options), Times.Once);
            _jsRuntime.VerifyNoOtherCalls();
        }
        public async ValueTask <IDropAnimation> DropAsync(Point point, DataSource source, decimal?height = null, DropAnimationOptions options = default)
        {
            _logger?.LogAzureMapsControlInfo(AzureMapLogEvent.AnimationService_Drop, "Calling DropAsync");

            Require.NotNull(point, nameof(point));
            return(await DropAsync(new[] { point }, source, height, options));
        }
        public async ValueTask <IDropAnimation> DropAsync(IEnumerable <Point> points, DataSource source, decimal?height = null, DropAnimationOptions options = default)
        {
            _logger?.LogAzureMapsControlInfo(AzureMapLogEvent.AnimationService_Drop, "Calling DropAsync");

            Require.NotNull(points, nameof(points));
            Require.NotNull(source, nameof(source));

            _logger?.LogAzureMapsControlDebug(AzureMapLogEvent.AnimationService_Drop, "Points", points);
            _logger?.LogAzureMapsControlDebug(AzureMapLogEvent.AnimationService_Drop, "Source", source);
            _logger?.LogAzureMapsControlDebug(AzureMapLogEvent.AnimationService_Drop, "Height", height);
            _logger?.LogAzureMapsControlDebug(AzureMapLogEvent.AnimationService_Drop, "Options", options);

            var animation = new DropAnimation(Guid.NewGuid().ToString(), _jsRuntime);
            await _jsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.Drop.ToAnimationNamespace(), animation.Id, points, source.Id, height, options);

            animation.Disposed = options.DisposeOnComplete.GetValueOrDefault();
            return(animation);
        }