void OptimizeBeforeQueryStatus(object sender, bool lossy)
        {
            var button = (OleMenuCommand)sender;
            IEnumerable <string> paths = ProjectHelpers.GetSelectedItemPaths(_dte);

            button.Visible = paths.Any();
            button.Enabled = true;

            if (button.Visible && _isProcessing)
            {
                button.Enabled = false;
            }
        }
        void OptimizeBeforeQueryStatus(object sender, bool lossy)
        {
            OleMenuCommand button = (OleMenuCommand)sender;
            var            paths  = ProjectHelpers.GetSelectedItemPaths();

            bool isPlural = IsPlural(paths);

            var text = isPlural ? " Optimize Images" : " Optimize Image";

            button.Text    = (lossy ? "Lossy" : "Lossless") + text;
            button.Visible = paths.Any();
            button.Enabled = true;

            if (button.Visible && _isProcessing)
            {
                button.Enabled = false;
                button.Text   += " (running)";
            }
        }