public bool saveDatabase()
 {
     try
     {
         RocketPluginStorage storage = new RocketPluginStorage();
         foreach (RocketPlugin p in Plugins)
         {
             storage.Plugins.Add(p);
         }
         return(storage.save(PluginDatabaseFile));
     }
     catch (Exception)
     {
         return(false);
     }
 }
        private void loadPlugins(RocketPluginStorage storage)
        {
            Plugins.Clear();

            if (!PluginFolder.Exists)
            {
                PluginFolder.Create();
                return;
            }

            try
            {
                foreach (FileInfo pfile in PluginFolder.GetFiles("*.dll"))
                {
                    try
                    {
                        RocketPlugin plugin = findPlugin(pfile.Name, storage);
                        add(plugin);
                    }
                    catch (Exception)
                    {
                        continue;
                    }
                }

                foreach (FileInfo pfile in PluginFolder.GetFiles("*.dll.inactive"))
                {
                    try
                    {
                        RocketPlugin plugin = findPlugin(pfile.Name, storage);
                        add(plugin);
                    }
                    catch (Exception)
                    {
                        continue;
                    }
                }
            }
            catch (Exception)
            {
                storage.save(PluginDatabaseFile);
            }
        }
 private RocketPlugin findPlugin(string pluginName, RocketPluginStorage storage)
 {
     return(storage.Plugins.First(pl => pl.PluginFileInfo.Name.Equals(pluginName)));
 }
 public void reload()
 {
     loadPlugins(RocketPluginStorage.load(PluginDatabaseFile.FullName));
 }