Beispiel #1
0
        public PluginInfo Init(int id, PluginInitContext context)
        {
            PluginInfo pi = new PluginInfo();

            CppPluginInterop.Init(id);
            return(pi);
        }
Beispiel #2
0
 public List <IPlugin> GetPlugins(PluginInitContext context)
 {
     for (int a = 0; a < CppPluginInterop.GetPluginCount(); a++)
     {
         var p = new CppPluginWrapper(this, a);
         p.Init(context);
         plugins_.Add(p);
     }
     return(plugins_);
 }
Beispiel #3
0
 public List <Result> Query(int id, Query query)
 {
     try
     {
         var data = CppPluginInterop.Query(id, Marshal.StringToCoTaskMemAuto(query.RawQuery));
         var r    = Marshal.PtrToStringAuto(data);
         if (r != null && r != "")
         {
             return(new List <Result>()
             {
                 new Result()
                 {
                     Title = r,
                 }
             });
         }
     }
     catch (Exception) { }
     return(null);
 }
Beispiel #4
0
 public void RunCommand(int id, string command)
 {
     CppPluginInterop.RunCommand(id, Marshal.StringToCoTaskMemAuto(command));
 }
Beispiel #5
0
 public void ShowPanel(int id, string command)
 {
     CppPluginInterop.ShowPanel(id, Marshal.StringToCoTaskMemAuto(command));
 }