Example #1
0
 public void DisplayProcedure(Program program, Procedure proc)
 {
     if (proc == null)
         return;
     var pane = new CodeViewerPane();
     var frame = ShowWindow("codeViewerWindow", proc.Name, proc, pane);
     pane.FrameWindow = frame;
     pane.DisplayProcedure(program, proc);
 }
Example #2
0
 public void DisplayDataType(Program program, DataType dt)
 {
     if (dt == null)
         return;
     var pane = new CodeViewerPane();
     var frame = ShowWindow("codeViewerWindow", dt.Name, dt, pane);
     pane.FrameWindow = frame;
     pane.DisplayDataType(program, dt);
 }
Example #3
0
 public void Setup()
 {
     mr = new MockRepository();
     codeViewer = new CodeViewerPane();
     decompilerSvc = mr.Stub<IDecompilerService>();
     decompiler = mr.Stub<IDecompiler>();
     uiPreferencesSvc = mr.Stub<IUiPreferencesService>();
     uiSvc = mr.Stub<IDecompilerShellUiService>();
     font = new Font("Arial", 10);
     var sc = new ServiceContainer();
     decompilerSvc.Decompiler = decompiler;
     sc.AddService<IDecompilerService>(decompilerSvc);
     sc.AddService<IUiPreferencesService>(uiPreferencesSvc);
     sc.AddService<IDecompilerShellUiService>(uiSvc);
     codeViewer.SetSite(sc);
 }
Example #4
0
        public CodeViewerFrame()
        {
            InitializeComponent();

            var pane = new CodeViewerPane();
            pane.FrameWindow = this;
            Pane = pane;

            var sc = new ServiceContainer();
            var uiSvc = new FakeDecompilerShellUiService();
            var cfgSvc = new FakeConfigurationService();
            sc.AddService(typeof(IDecompilerShellUiService), uiSvc);
            sc.AddService(typeof(IConfigurationService), cfgSvc);
            var uipSvc = new UiPreferencesService(cfgSvc, new FakeSettingsService());
            uipSvc.Load();
            sc.AddService(typeof(IUiPreferencesService), uipSvc);

            pane.SetSite(sc);
            var ctrl = pane.CreateControl();
            ctrl.Dock = DockStyle.Fill;
            pane.DisplayDataType(new Reko.Core.Program(), CreateDataType());
            Controls.Add(ctrl);
        }
        public void Setup()
        {
            mr = new MockRepository();
            mockFactory = new MockFactory(mr);
            var platform = mockFactory.CreatePlatform(); ;

            program = new Program
            {
                Architecture = platform.Architecture,
                Platform = platform,
            };
            codeViewer = new CodeViewerPane();
            decompilerSvc = mr.Stub<IDecompilerService>();
            decompiler = mr.Stub<IDecompiler>();
            uiPreferencesSvc = mr.Stub<IUiPreferencesService>();
            uiSvc = mr.Stub<IDecompilerShellUiService>();
            frame = mr.Stub<IWindowFrame>();
            font = new Font("Arial", 10);
            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();
            decompilerSvc.Decompiler = decompiler;
            sc.AddService<IDecompilerService>(decompilerSvc);
            sc.AddService<IUiPreferencesService>(uiPreferencesSvc);
            sc.AddService<IDecompilerShellUiService>(uiSvc);
            codeViewer.SetSite(sc);
        }
Example #6
0
 public CodeViewerServiceImpl(IServiceProvider sp) : base(sp)
 {
     pane = new CodeViewerPane();
 }
Example #7
0
        public void Setup()
        {
            mr = new MockRepository();
            program = new Program();
            codeViewer = new CodeViewerPane();
            decompilerSvc = mr.Stub<IDecompilerService>();
            decompiler = mr.Stub<IDecompiler>();
            uiPreferencesSvc = mr.Stub<IUiPreferencesService>();
            uiSvc = mr.Stub<IDecompilerShellUiService>();
            frame = mr.Stub<IWindowFrame>();
            font = new Font("Arial", 10);
            var styles = new Dictionary<string, UiStyle>();
            uiPreferencesSvc.Stub(u => u.Styles).Return(styles);

            var sc = new ServiceContainer();
            decompilerSvc.Decompiler = decompiler;
            sc.AddService<IDecompilerService>(decompilerSvc);
            sc.AddService<IUiPreferencesService>(uiPreferencesSvc);
            sc.AddService<IDecompilerShellUiService>(uiSvc);
            codeViewer.SetSite(sc);
        }
 public CodeViewerServiceImpl(IServiceProvider sp) : base (sp)
 {
     pane = new CodeViewerPane();
 }