/// <summary> /// Invoke a module method /// </summary> /// <param name="module_name"> /// A <see cref="System.String"/> /// </param> /// <param name="method"> /// A <see cref="System.String"/> /// </param> /// <param name="list"> /// A <see cref="System.Object[]"/> /// </param> /// <returns> /// A <see cref="System.Object"/> /// </returns> public static object callMethod(string module_name, string method, params object[] list) { SBIModule mod = SBModule.getModule(module_name); Type mod_type = mod.GetType(); return(mod_type.GetMethod(method).Invoke(mod, list)); }
public static SBIModule getModule(string module) { if (!SBModule.moduleExists(module)) { return(null); } return((SBIModule)SBModule.available_modules[module]); }
/// <summary> /// Translate a string using gettext /// </summary> /// <param name='string_id'> /// String_id. /// </param> public static string _(string string_id) { string translated_str = Catalog.GetString(string_id); return(SBModule.do_action("lang_string", translated_str).ToString()); /* * object res = SBModule.do_action("lang_string", translated_str); * if( res == null ) * return translated_str; * return res.ToString(); */ }
/// <summary> /// Translate a string using gettext and a specific domain /// </summary> /// <param name='string_id'> /// String_id. /// </param> /// <param name='domain'> /// Domain. /// </param> public static string _(string string_id, string domain) { string translated_str = Catalog.GetString(string_id); return(SBModule.do_action("lang_string", translated_str).ToString()); }