SHOW:
|
|
- or go back to the newest paste.
| 1 | - | using System; |
| 1 | + | |
| 2 | - | using System.Collections.Generic; |
| 2 | + | |
| 3 | - | using System.ComponentModel; |
| 3 | + | |
| 4 | - | using System.Data; |
| 4 | + | |
| 5 | - | using System.Drawing; |
| 5 | + | |
| 6 | - | using System.Linq; |
| 6 | + | |
| 7 | - | using System.Text; |
| 7 | + | |
| 8 | - | using System.Windows.Forms; |
| 8 | + | |
| 9 | - | using System.Threading; |
| 9 | + | |
| 10 | Point newLoc = new Point(); | |
| 11 | ||
| 12 | - | namespace Books |
| 12 | + | |
| 13 | - | {
|
| 13 | + | |
| 14 | - | public partial class frmMain : Form |
| 14 | + | |
| 15 | - | {
|
| 15 | + | |
| 16 | - | int threadCount = 0; |
| 16 | + | |
| 17 | - | List<Thread> EasterEggThreads = new List<Thread>(); |
| 17 | + | |
| 18 | newLoc.X = 0; | |
| 19 | - | List<Books> Catalog = new List<Books>(); |
| 19 | + | |
| 20 | - | |
| 20 | + | |
| 21 | - | public frmMain() |
| 21 | + | |
| 22 | } | |
| 23 | - | CheckForIllegalCrossThreadCalls = false; |
| 23 | + | |
| 24 | {
| |
| 25 | - | InitializeComponent(); |
| 25 | + | |
| 26 | Thread.Sleep(1); | |
| 27 | } | |
| 28 | - | private void clearAll() |
| 28 | + | |
| 29 | Refresh(); | |
| 30 | - | txtAuthor.Clear(); |
| 30 | + | |
| 31 | - | txtTitle.Clear(); |
| 31 | + | |
| 32 | - | txtPrice.Clear(); |
| 32 | + | |
| 33 | - | tb_Format.Clear(); |
| 33 | + | |
| 34 | - | tb_fileSize.Clear(); |
| 34 | + | |
| 35 | - | tb_PageCount.Clear(); |
| 35 | + | |
| 36 | if (aControl is GroupBox) | |
| 37 | {
| |
| 38 | - | private void output() |
| 38 | + | |
| 39 | } | |
| 40 | - | int i; |
| 40 | + | |
| 41 | - | string[] outputList = new string[Catalog.Count+1]; |
| 41 | + | |
| 42 | while (((ListBox)aControl).Items.Count > 0) | |
| 43 | - | Books currentBook; |
| 43 | + | |
| 44 | ((ListBox)aControl).Items.RemoveAt(0); | |
| 45 | - | outputList[0] = "< new Book >"; |
| 45 | + | |
| 46 | - | for(i=1;i<=Catalog.Count;i++) |
| 46 | + | |
| 47 | ||
| 48 | - | currentBook = Catalog[i-1]; |
| 48 | + | |
| 49 | - | outputList[i] = currentBook.Title + " - " + currentBook.Author; |
| 49 | + | |
| 50 | mythread.Start(aControl); | |
| 51 | ||
| 52 | - | lbBooklist.Items.Clear(); |
| 52 | + | |
| 53 | - | lbBooklist.Items.AddRange(outputList); |
| 53 | + | |
| 54 | } |