Example #1
0
 //-------------------------------------------------------------------------------------------------------
 //this is Node-Espresso
 //the Espresso + NodeJS
 //-------------------------------------------------------------------------------------------------------
 public static int RunJsEngine(NativeEngineSetupCallback engineSetupCb)
 {
     //hello.espr -> not exist on disk
     //the engine will callback to our .net code
     //our .net can load file
     return(RunJsEngine(null, engineSetupCb));
 }
 //-------------------------------------------------------------------------------------------------------
 //this is Node-Espresso
 //the Espresso + NodeJS
 //-------------------------------------------------------------------------------------------------------
 public static int RunJsEngine(NativeEngineSetupCallback engineSetupCb)
 {
     //hello.espr -> not exist on disk
     //the engine will callback to our .net code
     //our .net can load file
     return RunJsEngine(null, engineSetupCb);
 }
        //-------------------------------------------------------------------------------------------------------
        //this is Espresso-ND
        //the Espresso + NodeJS
        //-------------------------------------------------------------------------------------------------------
        public static int RunJsEngine(NativeEngineSetupCallback engineSetupCb)
        {
            return(RunJsEngine(

                       // "hello.espr" not on disk,
                       //this make espresso-ND callback to LoadMainSrcFile() in our .net code
                       //and we can handle how to load the rest

                       new string[] { "hello.espr" },
                       engineSetupCb));
        }
        public static int RunJsEngine(string[] parameters, NativeEngineSetupCallback engineSetupCb)
        {
            List <string> nodeStartPars = new List <string>();

            nodeStartPars.Add("node"); //essential first parameter
            if (parameters != null)
            {
                nodeStartPars.AddRange(parameters);
            }

            return(RunJsEngine(nodeStartPars.Count, nodeStartPars.ToArray(), engineSetupCb));
        }
Example #5
0
        public static int RunJsEngine(string[] parameters, string[] nodeParameters, NativeEngineSetupCallback engineSetupCb)
        {
            List <string> nodeStartPars = new List <string>();

            nodeStartPars.Add("node");
            if (nodeParameters != null)
            {
                nodeStartPars.AddRange(nodeParameters);
            }
            nodeStartPars.Add("hello.espr");
            if (parameters != null)
            {
                nodeStartPars.AddRange(parameters);
            }
            return(RunJsEngine(nodeStartPars.Count, nodeStartPars.ToArray(), engineSetupCb));
        }
 public static int RunJsEngine(string[] otherNodeParameters, NativeEngineSetupCallback engineSetupCb)
 {
     List<string> nodeStartPars = new List<string>();
     //1.
     //default 2 pars
     //hello.espr -> not exist on disk
     //the engine will callback to our .net code
     //our .net can load file
     nodeStartPars.AddRange(new string[] { "node", "hello.espr" });
     //2. other pars
     if (otherNodeParameters != null)
     {
         nodeStartPars.AddRange(otherNodeParameters);
     }
     return RunJsEngine(nodeStartPars.Count, nodeStartPars.ToArray(), engineSetupCb);
 }
Example #7
0
        public static int RunJsEngine(string[] otherNodeParameters, NativeEngineSetupCallback engineSetupCb)
        {
            List <string> nodeStartPars = new List <string>();

            //1.
            //default 2 pars
            //hello.espr -> not exist on disk
            //the engine will callback to our .net code
            //our .net can load file
            nodeStartPars.AddRange(new string[] { "node", "hello.espr" });
            //2. other pars
            if (otherNodeParameters != null)
            {
                nodeStartPars.AddRange(otherNodeParameters);
            }
            return(RunJsEngine(nodeStartPars.Count, nodeStartPars.ToArray(), engineSetupCb));
        }
Example #8
0
 static extern int RunJsEngine(int argc, string[] args, NativeEngineSetupCallback engineSetupCb);
 static extern int RunJsEngine(int argc, string[] args, NativeEngineSetupCallback engineSetupCb);