public static void Add(IList <ListItem> items) { var list = PyVariableManager.NewVariable(); string listCode = "["; for (int i = 0; i < items.Count; i++) { listCode += string.Format("({0},{1},{2})", PythonInterop.EscapeArgument(items[i].Url), items[i].Instance.PyName, items[i].IsFolder ); if (i + 1 < items.Count) { listCode += ","; } } listCode += "]"; PyVariable listVar = PyVariableManager.NewVariable(flags: PyVariableFlags.Object); listVar.Value = listCode; PythonInterop.CallFunction( new PythonFunction(PyModule.XbmcPlugin, "addDirectoryItems"), new List <object> { KodiBridge.RunningAddon.Handle, listVar, items.Count } ); }
/// <summary> /// Returns a legal filename or path as a string. /// </summary> /// <param name="filename"></param> /// <param name="fatX"></param> /// <returns></returns> public static string makeLegalFilename(string filename, bool fatX = false) { return(PythonInterop.CallFunction( new PyFunction(PyModule.Xbmc, "makeLegalFilename"), filename, fatX )); }
/// <summary> /// Returns the validated path. /// </summary> /// <param name="path"></param> /// <returns></returns> public static string validatePath(string path) { return(PythonInterop.CallFunction( new PyFunction(PyModule.Xbmc, "validatePath"), path )); }
/// <summary> /// Returns a thumb cache filename. /// </summary> /// <param name="path"></param> /// <returns></returns> public static string getCacheThumbName(string path) { return(PythonInterop.CallFunction( new PyFunction(PyModule.Xbmc, "getCacheThumbName"), path )); }
/// <summary> /// Returns the validated path. /// </summary> /// <param name="path"></param> /// <returns></returns> public static string validatePath(string path) { return(PythonInterop.CallFunction( new PythonFunction(PyModule.Xbmc, "validatePath"), new List <object> { path } )); }
/// <summary> /// Returns a thumb cache filename. /// </summary> /// <param name="path"></param> /// <returns></returns> public static string getCacheThumbName(string path) { return(PythonInterop.CallFunction( new PythonFunction(PyModule.Xbmc, "getCacheThumbName"), new List <object> { path } )); }
public static void Show(bool succeded = true, bool updateListing = false, bool cacheToDisc = true) { PythonInterop.CallFunction( new PythonFunction(PyModule.XbmcPlugin, "endOfDirectory"), new List <object> { KodiBridge.RunningAddon.Handle, succeded, updateListing, cacheToDisc } ); }
public static void Add(ListItem item) { PythonInterop.CallFunction( new PythonFunction(PyModule.XbmcPlugin, "addDirectoryItem"), new List <object> { KodiBridge.RunningAddon.Handle, item.Url, item.Instance, item.IsFolder } ); }
public static void Add(IList <ListItem> items) { var list = PyVariableManager.Get.NewVariable(); string listCode = items.ToPythonCode(); using (PyVariable listVar = PyVariableManager.Get.NewVariable(evalCode: listCode)) { PythonInterop.CallFunction( new PyFunction(PyModule.XbmcPlugin, "addDirectoryItems"), new List <object> { KodiBridge.RunningAddon.Handle, listVar, items.Count } ); } }
public dynamic Call(params object[] args) { return(PythonInterop.CallFunction(this, args)); }