private void OnBeforeQueryStatus(object sender, EventArgs e) { var launchPoint = (VsLaunchPoint)sender; var command = new VsMenuCommand { Enabled = launchPoint.Enabled, Text = launchPoint.Text, Visible = launchPoint.Visible }; launchPoint.OnQueryStatus(command); launchPoint.Enabled = command.Enabled; launchPoint.Visible = command.Visible; launchPoint.Text = command.Text; }
private static void OnExecute(object sender, EventArgs e) { var launchPoint = (VsLaunchPoint)sender; var command = new VsMenuCommand { Enabled = launchPoint.Enabled, Text = launchPoint.Text, Visible = launchPoint.Visible }; var extension = launchPoint.OnQueryStatus(command); if (command.Enabled) { launchPoint.Execute(extension); } else { var tracer = Tracer.Get <VsLaunchPoint>(); tracer.Warn(Resources.VsLaunchPoint_TraceNotEnabled, launchPoint); } }
private static void OnExecute(object sender, EventArgs e) { var launchPoint = (VsLaunchPoint)sender; var command = new VsMenuCommand { Enabled = launchPoint.Enabled, Text = launchPoint.Text, Visible = launchPoint.Visible }; var extension = launchPoint.OnQueryStatus(command); if (command.Enabled) { launchPoint.Execute(extension); } else { var tracer = Tracer.Get<VsLaunchPoint>(); tracer.Warn(Resources.VsLaunchPoint_TraceNotEnabled, launchPoint); } }