private void ToggleDeadCode(object s, EventArgs e) { if (DeadCodeMenuProxy == null) { return; } var result = DeadCodeMenuProxy.Toggle() ? "Disable" : "Enable"; toggleDeadCodeCommand.Text = result + " dead anotation analysis"; }
private void UpdateDeadCodeButton(OleMenuCommand cmd, int action) { var atv = ActiveTextView; var enabled = DeadCodeMenuProxy != null && atv?.TextBuffer != null && atv.TextBuffer.ContentType.IsOfType("dafny"); var act = DeadCodeMenuProxy?.GetSuggestedAction(atv, action); if (act == null) { enabled = false; } cmd.Properties.Remove("DeadCodeRemoval"); cmd.Visible = cmd.Enabled = enabled; if (!enabled) { return; } cmd.Text = act.DisplayText; cmd.Properties.Add("DeadCodeRemoval", act); }