} // END AddTorrentToolStripMenuItem_Click private void ExitMenu_Click(object sender, EventArgs e) { DllInterface.SetDebugStringOutputCb(null); DllInterface.DeInitTorrentManager(); mAppNotifyIcon.Dispose(); Application.Exit(); } // END ExitMenu_Click
} // END OptionsMenuItem_Click private void MainForm_FormClosed(object sender, FormClosedEventArgs e) { lock (mThreadLock) { DllInterface.SetDebugStringOutputCb(null); DllInterface.DeInitTorrentManager(); mAppNotifyIcon.Dispose(); //mTorrentWorkerThread.Abort("MK Shutdown Abort."); } } // END MainForm_FormClosed
public MainForm() { mSelectedTorrentId = (TorrentHandle)Torrent.TorrentValues.INVALID_TORRENT; versionChecked = false; mSyncContext = System.ComponentModel.AsyncOperationManager.SynchronizationContext; InitializeComponent(); #if DEBUG mOutputWnd = new ConsoleOutputWindow(); mOutputWnd.AddString("App Startup\n"); #endif debugStringDelegate = new DllInterface.DebugString_Delegate(DebugStringCallback); DllInterface.SetDebugStringOutputCb(debugStringDelegate); torrentManager = new BitTorrentManager(); DllInterface.InitTorrentManager(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)); // Create an instance of a ListView column sorter and assign it to the ListView control. lvwColumnSorter = new ListViewColumnSorter(); this.mPeersListView.ListViewItemSorter = lvwColumnSorter; }// END MainForm