public void InitializeControls() { InitializeTabsConsole(); uriParser = new SlUriParser(); if (instance.MediaManager.SoundSystemAvailable) { mediaConsole = new MediaConsole(instance); tbtnMedia.Visible = true; } }
private void frmMain_FormClosing(object sender, FormClosingEventArgs e) { if (statusTimer != null) { statusTimer.Stop(); statusTimer.Dispose(); statusTimer = null; } if (mediaConsole != null) { if (tabsConsole.TabExists("media")) { tabsConsole.Tabs["media"].AllowClose = true; tabsConsole.Tabs["media"].Close(); } else { mediaConsole.Dispose(); } mediaConsole = null; } if (netcom.IsLoggedIn) { Thread saveInvToDisk = new Thread(new ThreadStart( delegate() { client.Inventory.Store.SaveToDisk(instance.InventoryCacheFileName); })); saveInvToDisk.Name = "Save inventory to disk"; saveInvToDisk.Start(); netcom.Logout(); } }
private void frmMain_FormClosing(object sender, FormClosingEventArgs e) { if (instance.GlobalSettings["confirm_exit"].AsBoolean()) { if (MessageBox.Show("Are you sure you want to exit Radegast?", "Confirm Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != System.Windows.Forms.DialogResult.Yes) { e.Cancel = true; return; } } if (statusTimer != null) { statusTimer.Stop(); statusTimer.Dispose(); statusTimer = null; } if (mediaConsole != null) { if (tabsConsole.TabExists("media")) { tabsConsole.Tabs["media"].AllowClose = true; tabsConsole.Tabs["media"].Close(); } else { mediaConsole.Dispose(); } mediaConsole = null; } if (netcom.IsLoggedIn) { Thread saveInvToDisk = new Thread(new ThreadStart( delegate() { client.Inventory.Store.SaveToDisk(instance.InventoryCacheFileName); })); saveInvToDisk.Name = "Save inventory to disk"; saveInvToDisk.Start(); netcom.Logout(); } }