示例#1
0
 public bool Build(Script script = null)
 {
     if (_wscript != null)
     {
         _msc_compiler.Reset();
         _wscriptEcho.Length = 0;
     }
     SetLanguage(script);
     if (script == null)
     {
         _wscript = new WScript();
     }
     else
     {
         _wscript = new WScript(script.Path, script.Arguments);
     }
     _wscript.OnEcho += (m) => _wscriptEcho.AppendLine(m);
     _script          = script;
     _msc_compiler.AddObject("WScript", _wscript, false);
     //_compiler.AddCode("Function IIf(Expression, TruePart, FalsePart)\r\nIf Expression Then IIf = truepart Else IIf = falsepart\r\nEnd Function\r\n");
     if (script != null)
     {
         return(Execute(script.GetCode()));
     }
     return(true);
 }
示例#2
0
 public bool Compile(WScript wscript, Script script = null) {
     _wscript = wscript;
     if (_script != null)
         _compiler.Reset();
     _script = script;
     _compiler.AddObject("WScript", wscript, true);
     _compiler.AddCode("Function IIf(Expression, TruePart, FalsePart)\r\nIf Expression Then IIf = truepart Else IIf = falsepart\r\nEnd Function\r\n");
     if (script != null)
         return AddCode(script.GetCode());
     return true;
 }
示例#3
0
 public bool Compile(WScript wscript, Script script = null)
 {
     _wscript = wscript;
     if (_script != null)
     {
         _compiler.Reset();
     }
     _script = script;
     _compiler.AddObject("WScript", wscript, true);
     _compiler.AddCode("Function IIf(Expression, TruePart, FalsePart)\r\nIf Expression Then IIf = truepart Else IIf = falsepart\r\nEnd Function\r\n");
     if (script != null)
     {
         return(AddCode(script.GetCode()));
     }
     return(true);
 }
示例#4
0
 public bool Build(Script script = null) {
     if (_wscript != null) {
         _msc_compiler.Reset();
         _wscriptEcho.Length = 0;
     }
     SetLanguage(script);
     if (script == null) {
         _wscript = new WScript();
     } else {
         _wscript = new WScript(script.Path, script.Arguments);
     }
     _wscript.OnEcho += (m) => _wscriptEcho.AppendLine(m);
     _script = script;
     _msc_compiler.AddObject("WScript", _wscript, false);
     //_compiler.AddCode("Function IIf(Expression, TruePart, FalsePart)\r\nIf Expression Then IIf = truepart Else IIf = falsepart\r\nEnd Function\r\n");
     if (script != null)
         return Execute(script.GetCode());
     return true;
 }