BioImager  5.0.0
A .NET microscopy imaging application based on Bio library. Supports various microscopes by using imported libraries & GUI automation. Supports XInput game controllers to move stage, take images, run ImageJ macros on images or Bio C# scripts.
Loading...
Searching...
No Matches
SetTool.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Linq;
7using System.Text;
8using System.Threading.Tasks;
9using System.Windows.Forms;
10
11namespace BioImager
12{
13 public partial class SetTool : Form
14 {
15
16 /* The constructor for the class. */
17 public SetTool()
18 {
19 InitializeComponent();
20 timer.Start();
21 foreach (Scripting.Script tool in Scripting.Scripts.Values)
22 {
23 if (tool.type == Scripting.ScriptType.tool)
24 {
25 ListViewItem item = new ListViewItem();
26 item.Text = tool.name;
27 item.Tag = tool;
28 toolView.Items.Add(item);
29 }
30 }
31 }
32/* A property that returns the selected script. */
34 {
35 get { return (Scripting.Script)toolView.SelectedItems[0].Tag;}
36 }
41 private void setToolBut_Click(object sender, EventArgs e)
42 {
43 DialogResult = DialogResult.OK;
44
45 }
50 private void toolView_SelectedIndexChanged(object sender, EventArgs e)
51 {
52 if (Script.thread != null)
53 Script.Stop();
54 Script.Run();
55 }
56
62 private void timer_Tick(object sender, EventArgs e)
63 {
64 foreach (ListViewItem item in toolView.Items)
65 {
66 item.Text = ((Scripting.Script)item.Tag).ToString();
67 }
68 }
69
76 private void stopToolStripMenuItem_Click(object sender, EventArgs e)
77 {
78 if (Script.thread != null)
79 Script.Stop();
80 }
81 }
82}
static Dictionary< string, Script > Scripts
Definition Scripting.cs:15
Scripting.Script Script
Definition SetTool.cs:34