/// <inheritdoc/>
 public async ValueTask DisposeAsync()
 {
     if (JSObjectReference != null)
     {
         await JSObjectReference.DisposeAsync();
     }
 }
Example #2
0
 public async ValueTask DisposeAsync()
 {
     if (_langJs is not null)
     {
         await _langJs.DisposeAsync();
     }
 }
Example #3
0
        public async ValueTask DisposeAsync()
        {
            if (_animationJs is not null)
            {
                var start = _registeredStartEvents
                            .Select(s => new KeyValuePair <ElementReference, string>(s.Value.Element, s.Value.AnimationName));
                var iteration = _registeredIterationEvents
                                .Select(s => new KeyValuePair <ElementReference, string>(s.Value.Element, s.Value.AnimationName));
                var end = _registeredEndEvents
                          .Select(s => new KeyValuePair <ElementReference, string>(s.Value.Element, s.Value.AnimationName));

                await _animationJs.InvokeVoidAsync("dispose", start.ToArray(), iteration.ToArray(), end.ToArray());

                await _animationJs.DisposeAsync();
            }

            foreach (var item in _registeredStartEvents)
            {
                item.Dispose();
            }
            foreach (var item in _registeredIterationEvents)
            {
                item.Dispose();
            }
            foreach (var item in _registeredEndEvents)
            {
                item.Dispose();
            }
        }
 public async ValueTask DisposeAsync()
 {
     if (_focusJs is not null)
     {
         await _focusJs.DisposeAsync();
     }
 }
Example #5
0
 async ValueTask IAsyncDisposable.DisposeAsync()
 {
     if (_js != null)
     {
         await _js.DisposeAsync();
     }
 }
Example #6
0
 protected virtual async ValueTask DisposeAsyncCore()
 {
     if (jsModule is not null)
     {
         await jsModule.DisposeAsync();
     }
 }
 public async ValueTask DisposeAsync()
 {
     if (_clipboardJs is not null)
     {
         await _clipboardJs.DisposeAsync();
     }
 }
Example #8
0
 public async ValueTask DisposeAsync()
 {
     if (this.moduleTask.IsValueCreated)
     {
         IJSObjectReference module = await this.moduleTask.Value;
         await module.DisposeAsync();
     }
 }
Example #9
0
 public async ValueTask DisposeAsync()
 {
     _objectRef?.Dispose();
     if (_pwaModule != null)
     {
         await _pwaModule.DisposeAsync();
     }
 }
Example #10
0
        protected virtual async ValueTask DisposeAsyncCore()
        {
            if (jsModule != null)
            {
                await jsModule.InvokeVoidAsync("dispose", scrollspyElement);

                await jsModule.DisposeAsync();
            }
        }
Example #11
0
        public async ValueTask DisposeAsync()
        {
            if (_clickJs is not null)
            {
                await _clickJs.InvokeVoidAsync("dispose", (object)_registeredElements.ToArray());

                await _clickJs.DisposeAsync();
            }
        }
Example #12
0
        // Use the async method when having at least on async call in dispose.
        public async ValueTask DisposeAsync()
        {
            // .NET references needs to be disposed. Not so important just here.
            _dotNetReference?.Dispose();
            await JSRuntime.InvokeVoidAsync("blazorResize.unRegister", nameof(MainLayout));

            // Dispose the javascript module.
            await _module.DisposeAsync();
        }
Example #13
0
        public async ValueTask DisposeAsync()
        {
            if (_transitionJs is not null)
            {
                await _transitionJs.InvokeVoidAsync("dispose", _registeredElements.ToArray());

                await _transitionJs.DisposeAsync();
            }
        }
Example #14
0
        public async ValueTask DisposeAsync()
        {
            if (_animationJs is not null)
            {
                await _animationJs.InvokeVoidAsync("dispose", _registeredStartEvents.ToArray(), _registeredIterationEvents.ToArray(), _registeredEndEvents.ToArray());

                await _animationJs.DisposeAsync();
            }
        }
Example #15
0
        protected virtual async ValueTask DisposeAsyncCore()
        {
            NavigationManager.LocationChanged -= OnLocationChanged;

            if (jsModule is not null)
            {
                await jsModule.DisposeAsync();
            }
        }
Example #16
0
        public async ValueTask DisposeAsync()
        {
            IsDisposing = true;

            if (asyncModule != null)
            {
                await asyncModule.DisposeAsync();
            }
            module?.Dispose();
        }
Example #17
0
        public async ValueTask DisposeAsync()
        {
            if (_scrollJs is not null)
            {
                await _scrollJs.InvokeVoidAsync("dispose",
                                                (object)_dotNetObjectReferences.Select(s => s.Value.EventId).ToArray());

                await _scrollJs.DisposeAsync();
            }
        }
        public async void Dispose()
        {
            if (jsModuleTask.IsValueCreated)
            {
                await jsModule.InvokeVoidAsync("stopCamera", VideoElement);

                await jsModule.DisposeAsync();
            }
            GC.SuppressFinalize(this);
        }
Example #19
0
        public async ValueTask DisposeAsync()
        {
            if (_mapsJs is not null)
            {
                await _mapsJs.InvokeVoidAsync("dispose", MapContainerId);

                await _mapsJs.DisposeAsync();
            }

            _dotNetObjectReference?.Dispose();
        }
Example #20
0
        public async ValueTask DisposeAsync()
        {
            GC.SuppressFinalize(this);

            if (_ChartJSInstance != null)
            {
                await _ChartJSInstance.InvokeVoidAsync("dispose");

                await _ChartJSInstance.DisposeAsync();
            }

            _Handler?.Dispose();
        }
Example #21
0
        public ValueTask DisposeAsync()
        {
            IJSObjectReference module = _module;

            _module = null;

            if (module != null)
            {
                return(module.DisposeAsync());
            }

            return(ValueTask.CompletedTask);
        }
Example #22
0
        protected virtual async ValueTask DisposeAsyncCore()
        {
            disposed = true;

            if (jsModule != null)
            {
                await jsModule.InvokeVoidAsync("dispose", toastElement);

                await jsModule.DisposeAsync();
            }

            dotnetObjectReference.Dispose();
        }
        protected virtual async ValueTask DisposeAsyncCore()
        {
            validationMessageStore?.Clear();

            if (jsModule != null)
            {
                await CloseDropDownAsync(fromInputElement);
                await CloseDropDownAsync(toInputElement);

                await jsModule.DisposeAsync();
            }

            Dispose(false);
        }
Example #24
0
        // Unregister the drop zone events
        public async ValueTask DisposeAsync()
        {
            if (_dropZoneInstance != null)
            {
                await _dropZoneInstance.InvokeVoidAsync("dispose");

                await _dropZoneInstance.DisposeAsync();
            }

            if (_module != null)
            {
                await _module.DisposeAsync();
            }
        }
        public async ValueTask DisposeAsync()
        {
            if (_clickJs is not null)
            {
                await _clickJs.InvokeVoidAsync("dispose", (object)_dotNetObjectReferences.Select(s => s.Value.ElementRef).ToArray());

                await _clickJs.DisposeAsync();
            }

            foreach (var item in _dotNetObjectReferences)
            {
                item.Dispose();
            }
        }
Example #26
0
        public async ValueTask DisposeAsync()
        {
            if (_geoJs is not null)
            {
                await _geoJs.InvokeVoidAsync("dispose",
                                             (object)_dotNetObjectReferences.Select(s => s.Value.HandlerId).Distinct().ToArray());

                await _geoJs.DisposeAsync();
            }

            foreach (var item in _dotNetObjectReferences)
            {
                item.Dispose();
            }
        }
Example #27
0
        public async ValueTask DisposeAsync()
        {
            if (_transitionJs is not null)
            {
                var registeredElements = _dotNetObjectReferences
                                         .Select(s => new KeyValuePair <ElementReference, string>(s.Value.Element, s.Value.TransitionPropertyName));
                await _transitionJs.InvokeVoidAsync("dispose", registeredElements.ToArray());

                await _transitionJs.DisposeAsync();
            }

            foreach (var item in _dotNetObjectReferences)
            {
                item.Dispose();
            }
        }
Example #28
0
        protected virtual async ValueTask DisposeAsyncCore()
        {
            disposed = true;

            // Microsoft violates the pattern - there is no protected virtual voud Dispose(bool) method and the IDisposable implementation is explicit.
            ((IDisposable)this).Dispose();

            if (jsModule != null)
            {
                await jsModule.InvokeVoidAsync("dispose", Id);

                await jsModule.DisposeAsync();
            }

            dotnetObjectReference.Dispose();
        }
Example #29
0
        protected virtual async ValueTask DisposeAsyncCore()
        {
            disposed = true;

            if (jsModule != null)
            {
                if (opened)
                {
                    // We need to remove backdrop when leaving "page" when HxOffcanvas is shown (opened).
                    await jsModule.InvokeVoidAsync("dispose", offcanvasElement);
                }

                await jsModule.DisposeAsync();
            }

            dotnetObjectReference.Dispose();
        }
Example #30
0
        protected virtual async ValueTask DisposeAsyncCore()
        {
            if (_elixModule is not null)
            {
                await _elixModule.DisposeAsync().ConfigureAwait(false);

                _elixModule = null;
            }
            if (_generalModule is not null)
            {
                await _generalModule.DisposeAsync().ConfigureAwait(false);

                _generalModule = null;
            }
            _openedChangeCallbackReference?.Dispose();
            _openedChangeCallbackReference = null;
        }