private void BeforeQueryStatus(object sender, EventArgs eventArgs)
{
TridionVSRazorExtensionPackage package = ((TridionVSRazorExtensionPackage)this.ServiceProvider);
DTE applicationObject = package.ApplicationObject;
var menuCommand = sender as OleMenuCommand;
if (menuCommand != null)
{
menuCommand.Visible = true;
if (applicationObject.SelectedItems != null)
{
foreach (SelectedItem item in applicationObject.SelectedItems)
{
if (!item.Name.EndsWith(".cshtml"))
{
menuCommand.Visible = false;
}
}
}
}
}