コード例 #1
0
ファイル: MenuStatusSetter.cs プロジェクト: nemerle/reko
 public MenuStatusSetter(EventHandler popupHandler, CommandMenuEventHandler clickHandler)
 {
     this.cmdStatus = new CommandStatus();
     this.cmdText = new CommandText();
     this.popupHandler = popupHandler;
     this.clickHandler = clickHandler;
 }
コード例 #2
0
 public void DviSupportMarkProcedure()
 {
     var status = new CommandStatus();
     var text = new CommandText();
     var ret = interactor.QueryStatus(new CommandID(CmdSets.GuidReko, CmdIds.ActionMarkProcedure), status, null);
     Assert.IsTrue(ret);
     Assert.AreEqual(MenuStatus.Enabled | MenuStatus.Visible, status.Status);
 }
コード例 #3
0
ファイル: ProgramDesigner.cs プロジェクト: relaxar/reko
 public override bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
 {
     if (cmdId.Guid == CmdSets.GuidReko)
     {
         switch (cmdId.ID)
         {
         case CmdIds.EditProperties: 
             status.Status = MenuStatus.Enabled|MenuStatus.Visible;
             return true;
         }
     }
     return base.QueryStatus(cmdId, status, text);
 }
コード例 #4
0
        public void Di_ItemsSelected_EnableCopy()
        {
            mr.ReplayAll();

            svc.Error("Nilz");
            lv.SelectedIndices.Add(0);

            var cmd = new CommandID(CmdSets.GuidReko, 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();
        }
コード例 #5
0
 public override bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
 {
     if (cmdId.Guid== CmdSets.GuidReko)
     {
         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);
 }
コード例 #6
0
        public bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
        {
            int cItems             = listProcedures.SelectedItems.Count;
            var singleItemSelected = cItems == 1;

            if (cmdId.Guid == CmdSets.GuidReko)
            {
                switch (cmdId.ID)
                {
                case CmdIds.ActionEditSignature:
                case CmdIds.ViewGoToAddress:
                    status.Status = singleItemSelected
                        ? MenuStatus.Enabled | MenuStatus.Visible
                        : MenuStatus.Visible;
                    return(true);
                }
            }
            return(false);
        }
コード例 #7
0
        public virtual bool QueryStatus(CommandID cmdID, CommandStatus status, CommandText txt)
        {
            if (cmdID.Guid == CmdSets.GuidReko)
            {
                switch (cmdID.ID)
                {
                case CmdIds.ViewFindWhatPointsHere:
                    status.Status = MenuStatus.Enabled | MenuStatus.Visible;
                    return(true);

                case CmdIds.ViewAsCode:
                    status.Status = details is CodeSearchDetails
                        ? MenuStatus.Enabled | MenuStatus.Visible | MenuStatus.Checked
                        : MenuStatus.Enabled | MenuStatus.Visible;
                    return(true);

                case CmdIds.ViewAsStrings:
                    status.Status = details is StringSearchDetails
                        ? MenuStatus.Enabled | MenuStatus.Visible | MenuStatus.Checked
                        : MenuStatus.Enabled | MenuStatus.Visible;
                    return(true);

                case CmdIds.ViewAsData:
                    status.Status = details is DataSearchDetails
                        ? MenuStatus.Enabled | MenuStatus.Visible | MenuStatus.Checked
                        : MenuStatus.Enabled | MenuStatus.Visible;
                    return(true);

                case CmdIds.ActionMarkProcedure:
                    status.Status = details is CodeSearchDetails
                        ? MenuStatus.Enabled | MenuStatus.Visible
                        : MenuStatus.Visible;
                    return(true);

                case CmdIds.ActionMarkType:
                    status.Status = details is CodeSearchDetails
                        ? MenuStatus.Visible
                        : MenuStatus.Enabled | MenuStatus.Visible;
                    return(true);
                }
            }
            return(false);
        }
コード例 #8
0
        public bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
        {
            int cItems             = listProcedures.SelectedItems.Count;
            var singleItemSelected = cItems == 1;
            ProgramProcedure pp    = default;

            if (singleItemSelected && listProcedures.SelectedItems[0].Tag is not null)
            {
                pp = (ProgramProcedure)listProcedures.SelectedItems[0].Tag;
            }
            if (cmdId.Guid == CmdSets.GuidReko)
            {
                switch (cmdId.ID)
                {
                case CmdIds.ActionEditSignature:
                case CmdIds.ViewGoToAddress:
                case CmdIds.ShowProcedureCallHierarchy:
                    status.Status = singleItemSelected
                        ? MenuStatus.Enabled | MenuStatus.Visible
                        : MenuStatus.Visible;
                    return(true);

#if DEBUG
                case CmdIds.ProcedureDebugTrace:
                    var st = MenuStatus.Visible;
                    if (singleItemSelected)
                    {
                        if (pp.Program.User.DebugTraceProcedures.Contains(pp.Procedure.Name))
                        {
                            st |= MenuStatus.Checked;
                        }
                        if (singleItemSelected)
                        {
                            st |= MenuStatus.Enabled;
                        }
                    }
                    status.Status = st;
                    return(true);
#endif
                }
            }
            return(false);
        }
コード例 #9
0
        public bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
        {
            var des = base.GetSelectedDesigner();

            if (des != null)
            {
                return(des.QueryStatus(cmdId, status, text));
            }
            if (cmdId.Guid == CmdSets.GuidReko)
            {
                switch (cmdId.ID)
                {
                case CmdIds.CollapseAllNodes: status.Status = MenuStatus.Visible | MenuStatus.Enabled; return(true);

                case CmdIds.CreateUserSegment: status.Status =
                    IsSegmentSelected()
                            ? MenuStatus.Visible | MenuStatus.Enabled
                            : MenuStatus.Visible;
                    return(true);
                }
            }
            return(false);
        }
コード例 #10
0
ファイル: InitialPageInteractor.cs プロジェクト: relaxar/reko
        public override bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
        {
            if (cmdId.Guid== CmdSets.GuidReko)
            {
                switch (cmdId.ID)
                {
                case CmdIds.ViewGoToAddress:
                case CmdIds.ViewShowAllFragments:
                case CmdIds.ViewShowUnscanned:
                case CmdIds.ActionMarkProcedure:
                case CmdIds.ActionRestartDecompilation:
                    status.Status = 0;
                    return true;
                case CmdIds.ActionNextPhase:
                    status.Status = CanAdvance 
                        ? MenuStatus.Visible | MenuStatus.Enabled
                        : MenuStatus.Visible;
                    text.Text = Resources.ScanBinaries;
                    return true;

                }
            }
            return base.QueryStatus(cmdId, status, text);
        }
コード例 #11
0
 public virtual bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
 {
     return false;
 }
コード例 #12
0
 public bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
 {
     return(false);
 }
コード例 #13
0
 public override bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
 {
     if (cmdId.Guid == CmdSets.GuidReko)
     {
         switch (cmdId.ID)
         {
         case CmdIds.ActionNextPhase:
             status.Status = MenuStatus.Visible | MenuStatus.Enabled;
             text.Text = Resources.ReconstructDataTypes;
             return true;
         }
     }
     return base.QueryStatus(cmdId, status, text);
 }
コード例 #14
0
 public bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
 {
     if (cmdId.Guid == CmdSets.GuidReko)
     {
         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;
 }
コード例 #15
0
ファイル: LoadedPageInteractor.cs プロジェクト: melbcat/reko
 public override bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
 {
     if (cmdId.Guid == CmdSets.GuidReko)
     {
         MenuCommand cmd = (MenuCommand) mpCmdidToCommand[cmdId.ID];
         if (cmd == null)
             return false;
         status.Status = (MenuStatus) cmd.OleStatus;
         return true;
     }
     return false;
 }
コード例 #16
0
 public virtual bool QueryStatus(CommandID cmdID, CommandStatus status, CommandText txt)
 {
     if (cmdID.Guid == CmdSets.GuidReko)
     {
         switch (cmdID.ID)
         {
         case CmdIds.ViewFindWhatPointsHere:
             status.Status = MenuStatus.Enabled | MenuStatus.Visible;
             return true;
         case CmdIds.ViewAsCode:
             status.Status = details == AddressSearchDetails.Code
                 ? MenuStatus.Enabled | MenuStatus.Visible | MenuStatus.Checked
                 : MenuStatus.Enabled | MenuStatus.Visible;
             return true;
         case CmdIds.ViewAsStrings:
             status.Status = details == AddressSearchDetails.Strings
                 ? MenuStatus.Enabled | MenuStatus.Visible | MenuStatus.Checked
                 : MenuStatus.Enabled | MenuStatus.Visible;
             return true;
         case CmdIds.ViewAsData:
             status.Status = details == AddressSearchDetails.Data
                 ? MenuStatus.Enabled | MenuStatus.Visible | MenuStatus.Checked
                 : MenuStatus.Enabled | MenuStatus.Visible;
             return true;
         case CmdIds.ActionMarkProcedure:
             status.Status = details == AddressSearchDetails.Code
                 ? MenuStatus.Enabled | MenuStatus.Visible
                 : MenuStatus.Visible;
             return true;
         case CmdIds.ActionMarkType:
             status.Status = details != AddressSearchDetails.Code
                 ? MenuStatus.Enabled | MenuStatus.Visible
                 : MenuStatus.Visible;
             return true;
         }
     }
     return false;
 }
コード例 #17
0
 public override bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
 {
     if (cmdId.Guid == CmdSets.GuidReko)
     {
         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);
 }
コード例 #18
0
ファイル: AddressSearchResult.cs プロジェクト: MavenRain/reko
 public virtual bool QueryStatus(CommandID cmdID, CommandStatus status, CommandText txt)
 {
     if (cmdID.Guid == CmdSets.GuidReko)
     {
         switch (cmdID.ID)
         {
         case CmdIds.ActionMarkProcedure:
         case CmdIds.ViewFindWhatPointsHere:
             status.Status = MenuStatus.Enabled|MenuStatus.Visible;
             return true;
         }
     }
     return false;
 }
コード例 #19
0
ファイル: DiagnosticsInteractor.cs プロジェクト: relaxar/reko
 public bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
 {
     if (cmdId.Guid == CmdSets.GuidReko)
     {
         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;
 }
コード例 #20
0
        public void Di_NoItemsSelected_DisableCopy()
        {
            mr.ReplayAll();

            var cmd = new CommandID(CmdSets.GuidReko, 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();
        }
コード例 #21
0
 public bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
 {
     var des = GetSelectedDesigner();
     if (des != null)
         return des.QueryStatus(cmdId, status, text);
     if (cmdId.Guid == CmdSets.GuidReko)
     {
         switch (cmdId.ID)
         {
         case CmdIds.CollapseAllNodes: status.Status = MenuStatus.Visible | MenuStatus.Enabled; return true;
         }
     }
     return false;
 }
コード例 #22
0
ファイル: MenuSystemTests.cs プロジェクト: nemerle/reko
        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;
        }
コード例 #23
0
 public bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
 {
     var des = GetSelectedDesigner();
     if (des == null)
         return false;
     return des.QueryStatus(cmdId, status, text);
 }
コード例 #24
0
ファイル: CodeViewerFrame.cs プロジェクト: gitter-badger/reko
 public bool QueryStatus(CommandID cmdId, CommandStatus status, CommandText text)
 {
     throw new NotImplementedException();
 }