/// <summary> /// Loads a pre-compiled assembly and processes it. /// </summary> /// <param name="fileName">The assembly's file name.</param> /// <returns>If the assembly could be loaded, and contains command methods, then it returns /// a new script object. Null otherwise.</returns> public static Script LoadAssembly(string fileName) { try { Script script = new Script(fileName); if (script.LoadDll()) { return(script); } return(null); } catch (Exception ex) { Plugin.Output.Show(); Plugin.Output.WriteLine(OutputStyle.Error, Res.err_script_LoadDll, fileName, ex.ToString()); return(null); } }
/// <summary> /// Loads a pre-compiled assembly and processes it. /// </summary> /// <param name="fileName">The assembly's file name.</param> /// <returns>If the assembly could be loaded, and contains command methods, then it returns /// a new script object. Null otherwise.</returns> public static Script LoadAssembly(string fileName) { try { Script script = new Script(fileName); if (script.LoadDll()) return script; return null; } catch (Exception ex) { Plugin.Output.Show(); Plugin.Output.WriteLine(OutputStyle.Error, Res.err_script_LoadDll, fileName, ex.ToString()); return null; } }