Example #1
0
 public void MovePluginToCorrectCollection(IPluginViewModel plugin)
 {
     if (PluginManager.IsInstalled(plugin.InternalName))
     {
         if (PluginManager.IsMarkedForRemoval(plugin.InternalName))
         {
             // installed & marked for removal -> marked for removal
             SetPluginToCollection(plugin, MarkedForRemovalPlugins);
         }
         else if (PluginManager.packages.Any(p => p.information.Name == plugin.InternalName) || PluginManager.IsFailed(plugin.InternalName))
         {
             // installed & (activated || failed activation) -> installed
             SetPluginToCollection(plugin, InstalledPlugins);
         }
         else
         {
             // installed, not activated -> fresh
             SetPluginToCollection(plugin, FreshPlugins);
         }
     }
     else
     {
         // not installed -> available
         SetPluginToCollection(plugin, AvailablePlugins);
     }
 }