Nothing to see here, move along

This commit is contained in:
Brant Martin
2019-09-07 12:10:08 -04:00
parent ff0d881273
commit aec03840cc
5 changed files with 72 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -51,5 +52,55 @@ namespace Torch.Server.ViewModels
this.Control.Resources.MergedDictionaries.Clear();
this.Control.Resources.MergedDictionaries.Add(dictionary);
}
public Brush Color
{
get {
switch (Plugin.State)
{
case PluginState.NotInitialized:
case PluginState.MissingDependency:
case PluginState.DisabledError:
return Brushes.Red;
case PluginState.UpdateRequired:
return Brushes.DodgerBlue;
case PluginState.UninstallRequested:
return Brushes.Gold;
case PluginState.NotInstalled:
case PluginState.DisabledUser:
return Brushes.Gray;
case PluginState.Enabled:
return Brushes.Transparent;
default:
throw new ArgumentOutOfRangeException();
}
}
}
public string ToolTip
{
get { switch (Plugin.State)
{
case PluginState.NotInitialized:
return "Error during load.";
case PluginState.DisabledError:
return "Disabled due to error on load.";
case PluginState.DisabledUser:
return "Disabled.";
case PluginState.UpdateRequired:
return "Update required.";
case PluginState.UninstallRequested:
return "Marked for uninstall.";
case PluginState.NotInstalled:
return "Not installed. Click 'Enable'";
case PluginState.Enabled:
return string.Empty;
case PluginState.MissingDependency:
return "Dependency missing. Check the log.";
default:
throw new ArgumentOutOfRangeException();
}
}
}
}
}