/
MainWindow_ArchiveEvents.cs
62 lines (53 loc) · 1.58 KB
/
MainWindow_ArchiveEvents.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ThoughtQ.FormFiles;
using ThoughtQ.Data;
namespace ThoughtQ
{
public partial class MainWindow : Form
{
private void archiveList_KeyDown(object sender, KeyEventArgs e)
{
if ((e.KeyCode == Keys.Delete) && archiveList.SelectedItems.Count > 0)
{
DeleteThought();
}
}
private void archiveList_DoubleClick(object sender, EventArgs e)
{
var selected = archiveList.SelectedItems;
foreach (ListViewItem item in selected)
{
Thought found = (Thought)item.Tag;
ThoughtInfo t = openThoughts.Find(i => (Thought)i.Tag == found);
if (t == null)
{
ListViewItem permItem = item;
ThoughtInfo tInfo = new ThoughtInfo(ref permItem, ref queue, this);
tInfo.Tag = found;
openThoughts.Add(tInfo);
tInfo.Show();
}
else
{
t.Focus();
}
}
}
private void restoreToolStripMenuItem_Click(object sender, EventArgs e)
{
RestoreThought();
}
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
{
DeleteThought();
}
}
}