public ScriptObject LoadFile(String fileName, Encoding encoding) { try { byte[] buffer = ScriptExtensions.GetFileBuffer(fileName); if (buffer.Length > 0 && buffer[0] == 0) { return(LoadTokens(fileName, ScorpioMaker.Deserialize(buffer))); } else { return(LoadString(fileName, encoding.GetString(buffer, 0, buffer.Length))); } } catch (System.Exception e) { throw new ScriptException("load file [" + fileName + "] is error : " + e.ToString()); } }
public ScriptObject LoadFile(String fileName, Encoding encoding) { return(LoadBuffer(fileName, ScriptExtensions.GetFileBuffer(fileName), encoding)); }