예제 #1
0
        public bool TryDisposeInBatch(RenderBatchBuilder batchBuilder, out Exception exception)
        {
            _componentWasDisposed = true;
            exception             = null;

            try
            {
                if (Component is IDisposable disposable)
                {
                    disposable.Dispose();
                }
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            // We don't expect these things to throw.
            RenderTreeDiffBuilder.DisposeFrames(batchBuilder, CurrentRenderTree.GetFrames());

            if (_hasAnyCascadingParameterSubscriptions)
            {
                RemoveCascadingParameterSubscriptions();
            }

            DisposeBuffers();

            return(exception == null);
        }
예제 #2
0
        /// <summary>
        /// Notifies the component that it is being disposed.
        /// </summary>
        public void NotifyDisposed(RenderBatchBuilder batchBuilder)
        {
            // TODO: Handle components throwing during dispose. Shouldn't break the whole render batch.
            if (_component is IDisposable disposable)
            {
                disposable.Dispose();
            }

            RenderTreeDiffBuilder.DisposeFrames(batchBuilder, _renderTreeBuilderCurrent.GetFrames());
        }
예제 #3
0
    private void CleanupComponentStateResources(RenderBatchBuilder batchBuilder)
    {
        // We don't expect these things to throw.
        RenderTreeDiffBuilder.DisposeFrames(batchBuilder, CurrentRenderTree.GetFrames());

        if (_hasAnyCascadingParameterSubscriptions)
        {
            RemoveCascadingParameterSubscriptions();
        }

        DisposeBuffers();
    }
예제 #4
0
        public void DisposeInBatch(RenderBatchBuilder batchBuilder)
        {
            _componentWasDisposed = true;

            // TODO: Handle components throwing during dispose. Shouldn't break the whole render batch.
            if (Component is IDisposable disposable)
            {
                disposable.Dispose();
            }

            RenderTreeDiffBuilder.DisposeFrames(batchBuilder, CurrrentRenderTree.GetFrames());

            if (_hasAnyCascadingParameterSubscriptions)
            {
                RemoveCascadingParameterSubscriptions();
            }
        }