-
Notifications
You must be signed in to change notification settings - Fork 0
/
Script.cs
37 lines (33 loc) · 1015 Bytes
/
Script.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
using EsapiEssentials.Plugin;
using AutoFlash;
using VMS.TPS.Common.Model.API;
using System.Windows;
[assembly: ESAPIScript(IsWriteable = true)]
namespace VMS.TPS
{
public class Script : ScriptBase
{
public override void Run(PluginScriptContext context)
{
if (context.Patient != null)
{
var esapiService = new EsapiService(context);
using (var ui = new UiRunner())
{
ui.Run(() =>
{
var window = new MainWindow();
var dialogService = new DialogService(window);
var viewModel = new MainViewModel(esapiService, dialogService);
window.DataContext = viewModel;
window.ShowDialog();
});
}
}
else
{
MessageBox.Show("Please open a patient.");
}
}
}
}