mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
Fix scroll issues
This commit is contained in:
@@ -11,7 +11,7 @@ namespace WinAlfred.PluginLoader
|
||||
private PluginMetadata metadata;
|
||||
|
||||
[DllImport("PyWinAlfred.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
||||
private extern static IntPtr ExecPython(string directory, string file,string method,string para);
|
||||
private extern static IntPtr ExecPython(string directory, string file, string method, string para);
|
||||
[DllImport("PyWinAlfred.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
||||
private extern static void InitPythonEnv();
|
||||
|
||||
@@ -22,16 +22,25 @@ namespace WinAlfred.PluginLoader
|
||||
|
||||
public List<Result> Query(Query query)
|
||||
{
|
||||
string s = Marshal.PtrToStringAnsi(ExecPython(metadata.PluginDirecotry, metadata.ExecuteFileName.Replace(".py", ""),"query",query.RawQuery));
|
||||
List<PythonResult> o = JsonConvert.DeserializeObject<List<PythonResult>>(s);
|
||||
List<Result> r = new List<Result>();
|
||||
foreach (PythonResult pythonResult in o)
|
||||
try
|
||||
{
|
||||
PythonResult ps = pythonResult;
|
||||
ps.Action = () => ExecPython(metadata.PluginDirecotry, metadata.ExecuteFileName.Replace(".py", ""),ps.ActionName,ps.ActionPara);
|
||||
r.Add(ps);
|
||||
string s = Marshal.PtrToStringAnsi(ExecPython(metadata.PluginDirecotry, metadata.ExecuteFileName.Replace(".py", ""), "query", query.RawQuery));
|
||||
List<PythonResult> o = JsonConvert.DeserializeObject<List<PythonResult>>(s);
|
||||
List<Result> r = new List<Result>();
|
||||
foreach (PythonResult pythonResult in o)
|
||||
{
|
||||
PythonResult ps = pythonResult;
|
||||
ps.Action = () => ExecPython(metadata.PluginDirecotry, metadata.ExecuteFileName.Replace(".py", ""), ps.ActionName, ps.ActionPara);
|
||||
r.Add(ps);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
return r;
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Init()
|
||||
|
||||
Reference in New Issue
Block a user