예제 #1
0
 public static string ComponentOpenReporter(string id, string ropenId, string componentIdPattern = "^.*")
 {
     if (!String.IsNullOrWhiteSpace(id))
     {
         Shell s = Shell.GetShell(id);
         if (s != null)
         {
             if (s.MainControl.Dispatcher.CheckAccess())
             {
                 if (!EventReporters.ContainsKey(ropenId))
                 {
                     EventReporter d = new EventReporter(componentIdPattern, s.Interrupter);
                     LinkManager.Manager.AddListener(s, d.ComponentEventListener);
                     EventReporters.TryAdd(ropenId, d);
                 }
                 return(ropenId);
             }
             else
             {
                 return(s.MainControl.Dispatcher.Invoke(new Func <String>(() => { return ComponentOpenReporter(s.ShellId, ropenId, componentIdPattern); })));
             }
         }
     }
     return("");
 }
예제 #2
0
 public void Clear()
 {
     lock (ManagerLock) {
         Devices.Clear();
         ManagerListeners.Clear();
         EventReporter.Clear();
     }
 }
예제 #3
0
        public static string ComponentEventReport(string ropenId)
        {
            string        s = null;
            EventReporter d = null;

            if (ropenId != null)
            {
                EventReporters.TryGetValue(ropenId, out d);
            }
            if (d != null && d.EventReportQueue.TryTake(out s, -1, d.Interrupt.GetToken))
            {
                return(s);
            }
            return("Error: Unknown ropen Id.");
        }
예제 #4
0
 public static void CloseProject()
 {
     Manager.Close();
     EventReporter.CloseProject();
 }
예제 #5
0
 public static void StartProject()
 {
     EventReporter.StartProject();
 }
예제 #6
0
 public static void ConfigProject()
 {
     Manager.Clear();
     EventReporter.ConfigProject();
 }