BioCore  5.0.0
A Windows .NET microscopy library and application for viewing, editing, and annotating images.
Loading...
Searching...
No Matches
SetTool.cs
Go to the documentation of this file.
1namespace BioCore
2{
3 public partial class SetTool : Form
4 {
5
6 /* Initializing the form. */
7 public SetTool()
8 {
9 InitializeComponent();
10 timer.Start();
11 foreach (Scripting.Script tool in Scripting.Scripts.Values)
12 {
13 if (tool.type == Scripting.ScriptType.tool)
14 {
15 ListViewItem item = new ListViewItem();
16 item.Text = tool.name;
17 item.Tag = tool;
18 toolView.Items.Add(item);
19 }
20 }
21 }
23 {
24 get { return (Scripting.Script)toolView.SelectedItems[0].Tag; }
25 }
30 private void setToolBut_Click(object sender, EventArgs e)
31 {
32 DialogResult = DialogResult.OK;
33
34 }
39 private void toolView_SelectedIndexChanged(object sender, EventArgs e)
40 {
41 if (Script.thread != null)
42 Script.Stop();
43 Script.Run();
44 }
45
51 private void timer_Tick(object sender, EventArgs e)
52 {
53 foreach (ListViewItem item in toolView.Items)
54 {
55 item.Text = ((Scripting.Script)item.Tag).ToString();
56 }
57 }
58
64 private void stopToolStripMenuItem_Click(object sender, EventArgs e)
65 {
66 if (Script.thread != null)
67 Script.Stop();
68 }
69 }
70}
static Dictionary< string, Script > Scripts
Definition Scripting.cs:16
Scripting.Script Script
Definition SetTool.cs:23