public void Dispose() { if (!opened) { Thread.Sleep(100); Dispose(); } else { loading.IClose(); } if (loading is ProgressLoading && thread.IsAlive) { thread.Abort(); } }