BioCore  5.0.0
A Windows .NET microscopy library and application for viewing, editing, and annotating images.
Loading...
Searching...
No Matches
BioCore.Recordings Class Reference
Inheritance diagram for BioCore.Recordings:

Classes

class  Node
 

Public Member Functions

 Recordings ()
 
void InitElements ()
 It's a function that adds nodes to a treeview.
 
void UpdateElements ()
 It clears the nodes of the treeview, then adds the nodes back in.
 
void OpenRecording (string file)
 
void OpenProperty (string file)
 

Static Public Member Functions

static void Perform (string act)
 
static object GetProperty (Automation.Action.ValueType automation, string pro)
 

Protected Member Functions

override void Dispose (bool disposing)
 Clean up any resources being used.
 

Detailed Description

Definition at line 3 of file Recordings.designer.cs.

Constructor & Destructor Documentation

◆ Recordings()

BioCore.Recordings.Recordings ( )

Definition at line 13 of file Recordings.cs.

14 {
15 InitializeComponent();
16 if (!Directory.Exists("Recordings"))
17 Directory.CreateDirectory("Recordings");
18 foreach (string file in Directory.GetFiles("Recordings"))
19 {
20 if (file.EndsWith("reco"))
21 OpenRecording(file);
22 else if (file.EndsWith("pro"))
23 OpenProperty(file);
24 }
25 foreach (Automation.Action.ValueType val in (Automation.Action.ValueType[])Enum.GetValues(typeof(Automation.Action.ValueType)))
26 {
27 propBox.Items.Add(val);
28 }
29
30 }
void OpenRecording(string file)
void OpenProperty(string file)

Member Function Documentation

◆ Dispose()

override void BioCore.Recordings.Dispose ( bool disposing)
protected

Clean up any resources being used.

Parameters
disposingtrue if managed resources should be disposed; otherwise, false.

Definition at line 14 of file Recordings.designer.cs.

15 {
16 if (disposing && (components != null))
17 {
18 components.Dispose();
19 }
20 base.Dispose(disposing);
21 }

◆ GetProperty()

static object BioCore.Recordings.GetProperty ( Automation.Action.ValueType automation,
string pro )
static

It gets the value of a property from the automation object

Parameters
automationThis is the automation object that is passed to the function.
proThe name of the property you want to get.
Returns
The value of the property.

Definition at line 191 of file Recordings.cs.

192 {
193 Automation.Recording rec = null;
194 if (Automation.Properties.ContainsKey(pro))
195 rec = (Automation.Recording)Automation.Properties[pro];
196 else
197 return null;
198 Recorder.AddLine("Recordings.Get(" + rec.Name + ");");
199 return rec.Get();
200 }

◆ InitElements()

void BioCore.Recordings.InitElements ( )

It's a function that adds nodes to a treeview.

Definition at line 32 of file Recordings.cs.

33 {
34 view.Nodes.Clear();
35 for (int i = 0; i < Automation.Recordings.Count; i++)
36 {
37
38 }
39 foreach (Automation.Recording rec in Automation.Recordings.Values)
40 {
41 TreeNode tr = new TreeNode();
42 Node n = new Node(rec, tr, Node.Type.recording);
43 tr.Tag = n;
44 tr.Text = rec.Name;
45 foreach (Automation.Action item in rec.List)
46 {
47 try
48 {
49 TreeNode tn = new TreeNode();
50 tn.Text = item.ToString();
51
52 Node no = new Node(item, tn,Node.Type.action);
53 no.recording = rec;
54 tn.Tag = no;
55 tr.Nodes.Add(tn);
56 }
57 catch (Exception)
58 {
59
60 }
61 }
62 view.Nodes.Add(tr);
63 }
64
65 propView.Nodes.Clear();
66 foreach (Automation.Recording rec in Automation.Properties.Values)
67 {
68 TreeNode tr = new TreeNode();
69 Node n = new Node(rec, tr, Node.Type.recording);
70 tr.Tag = n;
71 tr.Text = rec.Name;
72 foreach (Automation.Action item in rec.List)
73 {
74 try
75 {
76 TreeNode tn = new TreeNode();
77 tn.Text = item.ToString();
78
79 Node no = new Node(item, tn, Node.Type.action);
80 no.recording = rec;
81 tn.Tag = no;
82 tr.Nodes.Add(tn);
83 }
84 catch (Exception)
85 {
86
87 }
88 }
89 propView.Nodes.Add(tr);
90 }
91 }

◆ OpenProperty()

void BioCore.Recordings.OpenProperty ( string file)

This function opens a recording file and adds it to the Properties collection

Parameters
fileThe file path of the recording

Definition at line 393 of file Recordings.cs.

394 {
395 Automation.Recording rec = OpenRec(file);
396 Automation.Properties.Add(rec.Name,rec);
397 InitElements();
398 }
void InitElements()
It's a function that adds nodes to a treeview.
Definition Recordings.cs:32

◆ OpenRecording()

void BioCore.Recordings.OpenRecording ( string file)

This function opens a recording file and adds it to the Automation.Recordings dictionary

Parameters
fileThe file path to the recording

Definition at line 384 of file Recordings.cs.

385 {
386 Automation.Recording rec = OpenRec(file);
387 Automation.Recordings.Add(rec.Name,rec);
388 InitElements();
389 }

◆ Perform()

static void BioCore.Recordings.Perform ( string act)
static

It runs a recording

Parameters
actThe name of the recording you want to run.

Definition at line 179 of file Recordings.cs.

180 {
181 Automation.Recording rec = (Automation.Recording)Automation.Recordings[act];
182 rec.Run();
183 Recorder.AddLine("Recordings.Perform(" + rec.Name + ");");
184 }

◆ UpdateElements()

void BioCore.Recordings.UpdateElements ( )

It clears the nodes of the treeview, then adds the nodes back in.

Definition at line 93 of file Recordings.cs.

94 {
95 foreach (TreeNode rec in view.Nodes)
96 {
97 rec.Nodes.Clear();
98 Node n = (Node)rec.Tag;
99 foreach (Automation.Action item in n.recording.List)
100 {
101 try
102 {
103 TreeNode tr = new TreeNode();
104 tr.Text = item.ToString();
105 Node no = new Node(item, rec, Node.Type.action);
106 no.recording = n.recording;
107 tr.Tag = no;
108 rec.Nodes.Add(tr);
109 }
110 catch (Exception)
111 {
112
113 }
114 }
115 }
116 foreach (TreeNode rec in propView.Nodes)
117 {
118 rec.Nodes.Clear();
119 Node n = (Node)rec.Tag;
120 foreach (Automation.Action item in n.recording.List)
121 {
122 try
123 {
124 TreeNode tr = new TreeNode();
125 tr.Text = item.ToString();
126 Node no = new Node(item, rec, Node.Type.action);
127 no.recording = n.recording;
128 tr.Tag = no;
129 rec.Nodes.Add(tr);
130 }
131 catch (Exception)
132 {
133
134 }
135 }
136 }
137 }

The documentation for this class was generated from the following files: