Наследование: IWindowPane, ICommandTarget
        public void Setup()
        {
            mr = new MockRepository();
            mockFactory = new MockFactory(mr);
            var platform = mockFactory.CreatePlatform();
            var imageMap = new SegmentMap(Address32.Ptr32(0x05));
            program = new Program(imageMap, platform.Architecture, platform);
            interactor = new CombinedCodeViewInteractor();
            var uiPreferencesSvc = mr.Stub<IUiPreferencesService>();
            var uiSvc = mr.Stub<IDecompilerShellUiService>();

            var styles = new Dictionary<string, UiStyle>()
            {
                {
                    UiStyles.CodeWindow,
                    new UiStyle
                    {
                        Background = new SolidBrush(Color.White),
                    }
                }
            };
            uiPreferencesSvc.Stub(u => u.Styles).Return(styles);
            var sc = new ServiceContainer();
            sc.AddService<IUiPreferencesService>(uiPreferencesSvc);
            sc.AddService<IDecompilerShellUiService>(uiSvc);
            interactor.SetSite(sc);
        }
Пример #2
0
 public void DisplayGlobals(Program program, ImageSegment segment)
 {
     var pane = new CombinedCodeViewInteractor();
     var windowType = typeof(CombinedCodeViewInteractor).Name;
     var label = string.Format(Resources.SegmentGlobalsFmt, segment.Name);
     var frame = ShowWindow(windowType, label, segment, pane);
     ((CombinedCodeViewInteractor)frame.Pane).DisplayGlobals(program, segment);
 }
Пример #3
0
 public void DisplayStatement(Program program, Statement stm)
 {
     var pane = new CombinedCodeViewInteractor();
     var windowType = typeof(CombinedCodeViewInteractor).Name;
     var proc = stm.Block.Procedure;
     var frame = ShowWindow(windowType, proc.Name, proc, pane);
     ((CombinedCodeViewInteractor)frame.Pane).DisplayStatement(program, stm);
 }
Пример #4
0
 public void DisplayProcedure(Program program, Procedure proc)
 {
     if (proc == null)
         return;
     var pane = new CombinedCodeViewInteractor();
     var windowType = typeof(CombinedCodeViewInteractor).Name;
     var frame = ShowWindow(windowType, proc.Name, proc, pane);
     ((CombinedCodeViewInteractor)frame.Pane).DisplayProcedure(program, proc);
 }
Пример #5
0
        public void DisplayGlobals(Program program, ImageSegment segment)
        {
            var pane       = new CombinedCodeViewInteractor();
            var windowType = typeof(CombinedCodeViewInteractor).Name;
            var label      = string.Format(Resources.SegmentGlobalsFmt, segment.Name);
            var frame      = ShowWindow(windowType, label, segment, pane);

            ((CombinedCodeViewInteractor)frame.Pane).DisplayGlobals(program, segment);
        }
Пример #6
0
        public void DisplayStatement(Program program, Statement stm)
        {
            var pane       = new CombinedCodeViewInteractor();
            var windowType = typeof(CombinedCodeViewInteractor).Name;
            var proc       = stm.Block.Procedure;
            var frame      = ShowWindow(windowType, proc.Name, proc, pane);

            ((CombinedCodeViewInteractor)frame.Pane).DisplayStatement(program, stm);
        }
Пример #7
0
        public void DisplayProcedure(Program program, Procedure proc)
        {
            if (proc == null)
            {
                return;
            }
            var pane       = new CombinedCodeViewInteractor();
            var windowType = typeof(CombinedCodeViewInteractor).Name;
            var frame      = ShowWindow(windowType, proc.Name, proc, pane);

            ((CombinedCodeViewInteractor)frame.Pane).DisplayProcedure(program, proc);
        }