Resharper Spell Checker / ReSpeller / Actions / AboutAction.cs

using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using JetBrains.ActionManagement;
using JetBrains.Application.DataContext;
using JetBrains.Application.PluginSupport;

namespace ReSpeller.Actions
{
  [ActionHandler("SpellCheckerPlugin.About")]
  public class AboutAction : IActionHandler
  {
    #region IActionHandler Members

    public bool Update(IDataContext context, ActionPresentation presentation, DelegateUpdate nextUpdate)
    {
      // return true or false to enable/disable this action
      return true;
    }

    public void Execute(IDataContext context, DelegateExecute nextExecute)
    {
      Assembly assembly = Assembly.GetAssembly(typeof (AboutAction));
      object[] attributes = assembly.GetCustomAttributes(false);
      PluginDescriptionAttribute pluginDescription = (PluginDescriptionAttribute) attributes
        .FirstOrDefault(o => o is PluginDescriptionAttribute);
      AssemblyFileVersionAttribute assemblyVersion = (AssemblyFileVersionAttribute) attributes
        .FirstOrDefault(o => o is AssemblyFileVersionAttribute);
      
      MessageBox.Show(
        (pluginDescription != null ? pluginDescription.Text : "<no description>"),
        "About ReSpeller " + (assemblyVersion != null ? "v." + assemblyVersion.Version : ""),
        MessageBoxButtons.OK,
        MessageBoxIcon.Information);
    }

    #endregion
  }
}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.