示例#1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                // remove button from parents
                ParentDropdown?.UnRegister(this);
                ParentAddons?.UnRegister(this);

                JSRunner.DestroyButton(ElementId);
            }

            base.Dispose(disposing);
        }
示例#2
0
        /// <inheritdoc/>
        protected override async ValueTask DisposeAsync(bool disposing)
        {
            if (disposing)
            {
                // remove button from parents
                ParentDropdown?.NotifyButtonRemoved(this);
                ParentAddons?.UnRegister(this);

                if (Rendered)
                {
                    var task = JSRunner.DestroyButton(ElementId);

                    try
                    {
                        await task;
                    }
                    catch when(task.IsCanceled)
                    {
                    }