Esempio n. 1
0
 public static IDetectorPlugin UpdateDetector(IOpenRPAClient client, entity.Detector entity)
 {
     foreach (var d in detectorPluginTypes)
     {
         if (d.Key == entity.Plugin)
         {
             IDetectorPlugin plugin = Plugins.detectorPlugins.Where(x => x.Entity._id == entity._id).FirstOrDefault();
             if (plugin == null)
             {
                 return(AddDetector(client, entity));
             }
             try
             {
                 plugin.Stop();
                 plugin.Entity = entity;
                 if (string.IsNullOrEmpty(entity.name))
                 {
                     entity.name = plugin.Name;
                 }
                 plugin.Start();
                 return(plugin);
             }
             catch (Exception ex)
             {
                 Log.Error("OpenRPA.Interfaces.Plugins.AddDetector: " + ex.ToString());
             }
         }
     }
     return(null);
 }
Esempio n. 2
0
 public static IDetectorPlugin AddDetector(entity.Detector entity)
 {
     foreach (var d in detectorPluginTypes)
     {
         if (d.Key == entity.Plugin)
         {
             try
             {
                 IDetectorPlugin plugin = (IDetectorPlugin)Activator.CreateInstance(d.Value);
                 if (string.IsNullOrEmpty(entity.name))
                 {
                     entity.name = plugin.Name;
                 }
                 plugin.Initialize(entity);
                 Plugins.detectorPlugins.Add(plugin);
                 return(plugin);
             }
             catch (Exception ex)
             {
                 Log.Error("OpenRPA.Interfaces.Plugins.AddDetector: " + ex.ToString());
             }
         }
     }
     return(null);
 }
Esempio n. 3
0
 public static IDetectorPlugin AddDetector(IOpenRPAClient client, entity.Detector entity)
 {
     foreach (var d in detectorPluginTypes)
     {
         if (d.Key == entity.Plugin)
         {
             try
             {
                 IDetectorPlugin plugin = (IDetectorPlugin)Activator.CreateInstance(d.Value);
                 if (string.IsNullOrEmpty(entity.name))
                 {
                     entity.name = plugin.Name;
                 }
                 plugin.Initialize(client, entity);
                 IDetectorPlugin exists = Plugins.detectorPlugins.Where(x => x.Entity._id == entity._id).FirstOrDefault();
                 if (exists == null)
                 {
                     Plugins.detectorPlugins.Add(plugin);
                 }
                 return(plugin);
             }
             catch (Exception ex)
             {
                 Log.Error("OpenRPA.Interfaces.Plugins.AddDetector: " + ex.ToString());
             }
         }
     }
     return(null);
 }
Esempio n. 4
0
 public void Initialize(entity.Detector InEntity)
 {
     Entity = InEntity;
     Start();
 }
Esempio n. 5
0
 public void Initialize(IOpenRPAClient client, entity.Detector InEntity)
 {
     Entity = InEntity;
     Start();
 }