public MenuStatusSetter(EventHandler popupHandler, CommandMenuEventHandler clickHandler) { this.cmdStatus = new CommandStatus(); this.cmdText = new CommandText(); this.popupHandler = popupHandler; this.clickHandler = clickHandler; }
public override bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text) { if (cmdId.Guid == CmdSets.GuidDecompiler) { switch (cmdId.ID) { case CmdIds.EditProperties: status.Status = MenuStatus.Enabled|MenuStatus.Visible; return true; } } return base.QueryStatus(cmdId, status, text); }
public override bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text) { if (cmdId.Guid== CmdSets.GuidDecompiler) { switch (cmdId.ID) { case CmdIds.ViewGoToAddress: case CmdIds.ViewShowAllFragments: case CmdIds.ViewShowUnscanned: case CmdIds.ActionEditSignature: case CmdIds.ActionMarkProcedure: status.Status = 0; return true; } } return base.QueryStatus(cmdId, status, text); }
public void GotoAddressEnabled() { var status = new CommandStatus(); Assert.IsTrue(interactor.QueryStatus(new CommandID(CmdSets.GuidDecompiler, CmdIds.ViewGoToAddress), status, null)); Assert.AreEqual(MenuStatus.Enabled | MenuStatus.Visible, status.Status); }
public virtual bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text) { return false; }
public override bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text) { if (cmdId.Guid == CmdSets.GuidDecompiler) { MenuCommand cmd = (MenuCommand) mpCmdidToCommand[cmdId.ID]; if (cmd == null) return false; status.Status = (MenuStatus) cmd.OleStatus; return true; } return false; }
public bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text) { var des = GetSelectedDesigner(); if (des == null) return false; return des.QueryStatus(cmdId, status, text); }
public bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text) { if (cmdId.Guid == CmdSets.GuidDecompiler) { switch (cmdId.ID) { case CmdIds.ViewGoToAddress: status.Status = MenuStatus.Enabled | MenuStatus.Visible; return true; case CmdIds.ActionMarkProcedure: status.Status = MenuStatus.Enabled | MenuStatus.Visible; return true; } } return false; }
public void SetItemVisibility(CommandMenuItem item, CommandStatus cmdStatus) { item.Visible = (cmdStatus.Status & MenuStatus.Visible) != 0; item.Enabled = (cmdStatus.Status & MenuStatus.Enabled) != 0; item.Checked = (cmdStatus.Status & MenuStatus.Checked) != 0; }
public bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text) { if (cmdId.Guid == CmdSets.GuidDecompiler) { switch (cmdId.ID) { case CmdIds.EditCopy: status.Status = listView.SelectedIndices.Count > 0 ? MenuStatus.Visible | MenuStatus.Enabled : MenuStatus.Visible; return true; case CmdIds.EditSelectAll: status.Status = MenuStatus.Visible | MenuStatus.Enabled; return true; } } return false; }
public void Di_NoItemsSelected_DisableCopy() { mr.ReplayAll(); var cmd = new CommandID(CmdSets.GuidDecompiler, CmdIds.EditCopy); var status = new CommandStatus(); var txt = new CommandText(); Assert.IsTrue(interactor.QueryStatus(cmd, status, txt)); Assert.AreEqual(MenuStatus.Visible, status.Status); mr.VerifyAll(); }
public void Di_ItemsSelected_EnableCopy() { mr.ReplayAll(); svc.Error("Nilz"); lv.SelectedIndices.Add(0); var cmd = new CommandID(CmdSets.GuidDecompiler, CmdIds.EditCopy); var status = new CommandStatus(); var txt = new CommandText(); Assert.IsTrue(interactor.QueryStatus(cmd, status, txt)); Assert.AreEqual(MenuStatus.Visible|MenuStatus.Enabled, status.Status); mr.VerifyAll(); }
//$REFACTOR: copied from LoadedPageInteractor, should // push to base class or utility class. private MenuStatus QueryStatus(int cmdId) { CommandStatus status = new CommandStatus(); i.QueryStatus(new CommandID(CmdSets.GuidDecompiler, cmdId), status, null); return status.Status; }
public void DviSupportMarkProcedure() { var status = new CommandStatus(); var text = new CommandText(); var ret = interactor.QueryStatus(new CommandID(CmdSets.GuidDecompiler, CmdIds.ActionMarkProcedure), status, null); Assert.IsTrue(ret); Assert.AreEqual(MenuStatus.Enabled | MenuStatus.Visible, status.Status); }
public void LLI_GotoAddressEnabled() { Given_Architecture(); Given_Program(new byte[0x13000]); Given_Interactor(); mr.ReplayAll(); When_ShowControl(); control.MemoryView.Focus(); var status = new CommandStatus(); Assert.IsTrue(interactor.QueryStatus(new CommandID(CmdSets.GuidDecompiler, CmdIds.ViewGoToAddress), status, null)); Assert.AreEqual(status.Status, MenuStatus.Enabled | MenuStatus.Visible); }
public override bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text) { if (cmdId.Guid == CmdSets.GuidDecompiler) { switch (cmdId.ID) { case CmdIds.ActionEditSignature: status.Status = MenuStatus.Visible; if (SelectedProcedureEntry.Key != null) status.Status |= MenuStatus.Enabled; return true; } } return base.QueryStatus(cmdId, status, text); }
public bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text) { if (mruFirst <= cmdId.ID && cmdId.ID < mruMax) { status.Status = MenuStatus.Visible|MenuStatus.Enabled; text.Text = string.Format("MRU {0}", cmdId.ID - mruFirst); return true; } if (mpCmdIdToStatus.Contains(cmdId.ID)) { status.Status = (MenuStatus) mpCmdIdToStatus[cmdId.ID]; Console.WriteLine("Testring cmd {0}: status {1}", cmdId.ID, status.Status); return true; } return false; }