void ReleaseDesignerOutlets() { if (DownloadButton != null) { DownloadButton.Dispose(); DownloadButton = null; } if (DownloadProgressBar != null) { DownloadProgressBar.Dispose(); DownloadProgressBar = null; } if (IdLabel != null) { IdLabel.Dispose(); IdLabel = null; } if (NameLabel != null) { NameLabel.Dispose(); NameLabel = null; } if (SlotNameLabel != null) { SlotNameLabel.Dispose(); SlotNameLabel = null; } }
public static void WaitAndDispose() { while (DownloadProgressBar.CurrentTick < DownloadProgressBar.MaxTicks) { Thread.Sleep(20); } DownloadProgressBar.Dispose(); }