|
| enum | FunctionType {
Key
, Microscope
, Objective
, StoreCoordinate
,
NextCoordinate
, PreviousCoordinate
, NextSnapCoordinate
, PreviousSnapCoordinate
,
Recording
, Property
, ImageJ
, Script
,
None
} |
| |
| enum | ButtonState { Pressed
, Released
} |
| |
|
| ButtonState | State [get, set] |
| |
| VirtualKeyCode | Key [get, set] |
| |
| VirtualKeyCode | Modifier [get, set] |
| |
| FunctionType | FuncType [get, set] |
| |
| string | File [get, set] |
| |
| string | Script [get, set] |
| |
| string | Name [get, set] |
| |
| string | MenuPath [get, set] |
| |
| string | ContextPath [get, set] |
| |
| double | Value [get, set] |
| |
| string | Microscope [get, set] |
| |
Definition at line 309 of file FunctionForm.cs.
◆ ButtonState
◆ FunctionType
| Enumerator |
|---|
| Key | |
| Microscope | |
| Objective | |
| StoreCoordinate | |
| NextCoordinate | |
| PreviousCoordinate | |
| NextSnapCoordinate | |
| PreviousSnapCoordinate | |
| Recording | |
| Property | |
| ImageJ | |
| Script | |
| None | |
Definition at line 313 of file FunctionForm.cs.
◆ Initialize()
| static void BioCore.Function.Initialize |
( |
| ) |
|
|
static |
It reads all the files in the Functions folder, parses them into Function objects, and adds them to the Functions dictionary
Definition at line 532 of file FunctionForm.cs.
533 {
534 string st = Application.StartupPath + "/Functions";
535 if (!Directory.Exists(st))
536 Directory.CreateDirectory(st);
537 string[] sts = Directory.GetFiles(st);
538 for (int i = 0; i < sts.Length; i++)
539 {
540 string fs = System.IO.File.ReadAllText(sts[i]);
546 }
547 }
static void AddMenu(string menu)
static void AddContextMenu(string menu)
static Dictionary< string, Function > Functions
static Function Parse(string s)
◆ Parse()
| static Function BioCore.Function.Parse |
( |
string | s | ) |
|
|
static |
It takes a string, and if it's empty, it returns a new Function object. Otherwise, it returns a new Function object that is the deserialized version of the string
- Parameters
-
- Returns
- A function object.
Definition at line 477 of file FunctionForm.cs.
478 {
479 if (s == "")
481 return JsonConvert.DeserializeObject<
Function>(s);
482 }
◆ PerformFunction()
| object BioCore.Function.PerformFunction |
( |
bool | imagej | ) |
|
It runs a script or a keystroke
- Parameters
-
| imagej | boolean, whether to run the script as an ImageJ script or a C# script |
- Returns
- The return value is the result of the function.
Definition at line 498 of file FunctionForm.cs.
499 {
501 if (imagej)
502 {
504 }
505 else
508 {
510 }
512 {
514 }
515
517 {
518 if (
Modifier != VirtualKeyCode.NONAME)
519 {
521 }
522 else
523 {
525 }
526 return null;
527 }
528 return null;
529 }
static bool useBioformats
static InputSimulator input
ImageView control for image stacks, pyramidal and whole-slide-images.
static BioImage SelectedImage
static void RunString(string st)
◆ Save()
| void BioCore.Function.Save |
( |
| ) |
|
It saves all the functions in the Functions dictionary to a file.
Definition at line 549 of file FunctionForm.cs.
550 {
552
553 if (!Directory.Exists(st + "/Functions"))
554 {
555 Directory.CreateDirectory(st + "/Functions");
556 }
558 {
559 System.IO.File.WriteAllText(st +
"/Functions/" + f.
Name +
".func", f.
Serialize());
560 }
561 }
System.Windows.Forms.Application Application
◆ Serialize()
| string BioCore.Function.Serialize |
( |
| ) |
|
"Serialize" is a function that takes an object and returns a string
- Returns
- The object is being serialized into a JSON string.
Definition at line 487 of file FunctionForm.cs.
488 {
489 return JsonConvert.SerializeObject(this);
490 }
◆ ToString()
| override string BioCore.Function.ToString |
( |
| ) |
|
◆ Functions
| Dictionary<string, Function> BioCore.Function.Functions = new Dictionary<string, Function>() |
|
static |
◆ input
| InputSimulator BioCore.Function.input = new InputSimulator() |
|
static |
◆ ContextPath
| string BioCore.Function.ContextPath |
|
getset |
Definition at line 431 of file FunctionForm.cs.
432 {
433 get
434 {
435 return contextPath;
436 }
437 set
438 {
439 contextPath = value;
440 }
441 }
◆ File
| string BioCore.Function.File |
|
getset |
Definition at line 390 of file FunctionForm.cs.
391 {
392 get { return file; }
393 set { file = value; }
394 }
◆ FuncType
Definition at line 377 of file FunctionForm.cs.
378 {
379 get
380 {
381 return functionType;
382 }
383 set
384 {
385 functionType = value;
386 }
387 }
◆ Key
| VirtualKeyCode BioCore.Function.Key |
|
getset |
Definition at line 349 of file FunctionForm.cs.
350 {
351 get
352 {
353 return key;
354 }
355 set
356 {
357 key = value;
359 }
360 }
◆ MenuPath
| string BioCore.Function.MenuPath |
|
getset |
Definition at line 419 of file FunctionForm.cs.
420 {
421 get
422 {
423 return menuPath;
424 }
425 set
426 {
427 menuPath = value;
428 }
429 }
◆ Microscope
| string BioCore.Function.Microscope |
|
getset |
Definition at line 456 of file FunctionForm.cs.
457 {
458 get
459 {
460 return microscope;
461 }
462 set
463 {
464 microscope = value;
465 }
466 }
◆ Modifier
| VirtualKeyCode BioCore.Function.Modifier |
|
getset |
Definition at line 363 of file FunctionForm.cs.
364 {
365 get
366 {
367 return modifier;
368 }
369 set
370 {
372 modifier = value;
373 }
374 }
◆ Name
| string BioCore.Function.Name |
|
getset |
Definition at line 407 of file FunctionForm.cs.
408 {
409 get
410 {
411 return name;
412 }
413 set
414 {
415 name = value;
416 }
417 }
◆ Script
| string BioCore.Function.Script |
|
getset |
Definition at line 397 of file FunctionForm.cs.
398 {
399 get { return script; }
400 set
401 {
402 script = value;
403 }
404 }
◆ State
Definition at line 336 of file FunctionForm.cs.
337 {
338 get
339 {
340 return buttonState;
341 }
342 set
343 {
344 buttonState = value;
345 }
346 }
◆ Value
| double BioCore.Function.Value |
|
getset |
Definition at line 444 of file FunctionForm.cs.
445 {
446 get
447 {
448 return val;
449 }
450 set
451 {
452 val = value;
453 }
454 }
The documentation for this class was generated from the following file: