private void InitAllTasksInDefaultPlan()
 {
     if (m_defaultPlan != null)
     {
         m_defaultPlan.Iterate(true, executable =>
         {
             MyTask task = executable as MyTask;
             if (task != null && task != ExecuteScript)
             {
                 task.Init(GPU);
             }
         });
     }
 }
Example #2
0
    public static void Main(string[] args)
    {
        MyTask task = new MyTask();

        // Most methods that call a SWI throw an OS.ErrorException if the
        // SWI returns an error.
        try
        {
            task.Init();
            task.Run();
        }
        catch (OS.ErrorException ex)
        {
            Reporter.WriteLine(ex.OSError.Message);
            Console.WriteLine("error number = {0}, error string = {1}",
                              ex.OSError.Number,
                              ex.OSError.Message);
        }
        finally
        {
            task.CloseDown();
        }
    }