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

            CppPluginInterop.Init(id);
            return(pi);
        }
Example #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_);
 }
Example #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);
 }
Example #4
0
 public void RunCommand(int id, string command)
 {
     CppPluginInterop.RunCommand(id, Marshal.StringToCoTaskMemAuto(command));
 }
Example #5
0
 public void ShowPanel(int id, string command)
 {
     CppPluginInterop.ShowPanel(id, Marshal.StringToCoTaskMemAuto(command));
 }