示例#1
0
        public MainWindow()
        {
            InitializeComponent();
            try
            {
                service = Service.GetInstance();
            }
            catch (FileNotFoundException)
            {           
                    var msg = "File run_with_logs.py was not found! PsychoPy might not function properly.";
                    MessageBox.Show(msg, "File not found", MessageBoxButton.OK, MessageBoxImage.Error);            
            }
           

            service.ProgressUpdate += (s, e) =>
            {
                Dispatcher.Invoke(delegate
                {
                    var args = (StatusEventArgs) e;
                    lblStatus.Content = args.Message;
                }
                    );
            };
            InitClients();
            InitTabs();
            SetProject(unnamedProject);
            service.StartPingSvc(clients);

            // USE MSMQ if it is enabled
            if (service.MSMQConfig.MSMQ)
            {
                service.TransferLabClientService(clients);
                StartMSMQService();
            }
        }
示例#2
0
文件: Service.cs 项目: cobelab/LabRun
 public static Service GetInstance()
 {
     if (_service == null)
         _service = new Service();
     return _service;
 }