Beispiel #1
0
 public void ExecuteBackground(ApiBackgroundContext context)
 {
     Script.contextType = ScriptContextType.ApiBackground;
     Script.context     = context;
     try {
         entryPoint();
     } finally {
         Script.contextType = ScriptContextType.None;
         Script.context     = null;
     }
 }
 public void ExecuteBackground(ApiBackgroundContext context)
 {
     Script.contextType = ScriptContextType.ApiBackground;
     Script.context = context;
     try
     {
         entryPoint();
     }
     finally
     {
         Script.contextType = ScriptContextType.None;
         Script.context = null;
     }
 }
Beispiel #3
0
 public bool ExecuteApiBackground(string args)
 {
     // Background doesn't affect use count
     new System.Threading.Thread(() => {
         try {
             var context = new ApiBackgroundContext(args);
             var plugin  = createPlugin();
             plugin.ExecuteBackground(context);
             Log.WriteLine(LogLevel.Debug, "ExecuteBackground in {0} completed.", Name);
         } catch (Exception ex) {
             LogException("ExecuteBackground", Name, ex);
         }
     }).Start();
     return(true);
 }
 public bool ExecuteApiBackground(string args)
 {
     // Background doesn't affect use count
     new System.Threading.Thread(() =>
     {
         try
         {
             var context = new ApiBackgroundContext(args);
             var plugin = createPlugin();
             plugin.ExecuteBackground(context);
             Log.WriteLine(LogLevel.Debug, "ExecuteBackground in {0} completed.", Name);
         }
         catch (Exception ex)
         {
             LogException("ExecuteBackground", Name, ex);
         }
     }).Start();
     return true;
 }
 public void ExecuteBackground(ApiBackgroundContext context)
 {
     return;
 }
 public void ExecuteBackground(ApiBackgroundContext context)
 {
     throw new NotImplementedException();
 }