void dlg_Load(object sender, EventArgs e)
        {
            this.dlg.MemoryControl.Services = dlg.Services;
            this.uipSvc = dlg.Services.RequireService <IUiPreferencesService>();
            PopulateStyleTree();

            this.sc = new ServiceContainer();
            var cfgSvc      = dlg.Services.RequireService <IConfigurationService>();
            var settingsSvc = dlg.Services.RequireService <ISettingsService>();

            this.localSettings = new UiPreferencesService(cfgSvc, settingsSvc);
            sc.AddService <IUiPreferencesService>(localSettings);
            CopyStyles(uipSvc, localSettings);

            GenerateSimulatedProgram();
            dlg.MemoryControl.Services        = sc;
            dlg.MemoryControl.SegmentMap      = program.SegmentMap;
            dlg.MemoryControl.ImageMap        = program.ImageMap;
            dlg.MemoryControl.Architecture    = program.Architecture;
            dlg.MemoryControl.SelectedAddress = program.SegmentMap.BaseAddress;
            dlg.MemoryControl.Font            = new System.Drawing.Font("Lucida Console", 9.0f);
            dlg.DisassemblyControl.StyleClass = UiStyles.Disassembler;
            dlg.DisassemblyControl.Services   = sc;
            dlg.DisassemblyControl.Model      = new DisassemblyTextModel(program, program.SegmentMap.Segments.Values.First());
            dlg.CodeControl.Services          = sc;
            dlg.CodeControl.Model             = GenerateSimulatedHllCode();
        }
Beispiel #2
0
 private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (var dlg = new UserPreferencesDialog())
     {
         var sc     = new ServiceContainer();
         var cfgSvc = new FakeConfigurationService();
         sc.AddService(typeof(IConfigurationService), cfgSvc);
         var uipSvc = new UiPreferencesService(cfgSvc, new FakeSettingsService());
         uipSvc.Load();
         sc.AddService(typeof(IUiPreferencesService), uipSvc);
         dlg.Services = sc;
         dlg.ShowDialog(this);
     }
 }
        void dlg_Load(object sender, EventArgs e)
        {
            this.sc = new ServiceContainer();
            this.localSettings = new UiPreferencesService(null, null);
            sc.AddService(typeof(IUiPreferencesService), localSettings);

            GenerateSimulatedProgram();
            dlg.MemoryControl.ProgramImage = program.Image;
            dlg.MemoryControl.ImageMap = program.ImageMap;
            dlg.MemoryControl.Architecture = program.Architecture;
            dlg.MemoryControl.Font = localSettings.DisassemblerFont ?? new System.Drawing.Font("Lucida Console", 9.0f);
            dlg.DisassemblyControl.Model = null;/**/
            dlg.CodeControl.Model = null; /*;*/ 
        }
        void dlg_Load(object sender, EventArgs e)
        {
            this.sc            = new ServiceContainer();
            this.localSettings = new UiPreferencesService(null, null);
            sc.AddService(typeof(IUiPreferencesService), localSettings);

            GenerateSimulatedProgram();
            dlg.MemoryControl.ProgramImage = program.Image;
            dlg.MemoryControl.ImageMap     = program.ImageMap;
            dlg.MemoryControl.Architecture = program.Architecture;
            dlg.MemoryControl.Font         = localSettings.DisassemblerFont ?? new System.Drawing.Font("Lucida Console", 9.0f);
            dlg.DisassemblyControl.Model   = null; /**/
            dlg.CodeControl.Model          = null; /*;*/
        }
        void dlg_Load(object sender, EventArgs e)
        {
            this.dlg.MemoryControl.Services = dlg.Services;
            this.uipSvc = dlg.Services.RequireService <IUiPreferencesService>();
            PopulateStyleTree();

            this.sc            = new ServiceContainer();
            this.localSettings = new UiPreferencesService(null, null);
            sc.AddService(typeof(IUiPreferencesService), localSettings);
            CopyStyles(uipSvc, localSettings);

            GenerateSimulatedProgram();
            dlg.MemoryControl.Services      = sc;
            dlg.MemoryControl.ProgramImage  = program.Image;
            dlg.MemoryControl.ImageMap      = program.ImageMap;
            dlg.MemoryControl.Architecture  = program.Architecture;
            dlg.MemoryControl.Font          = new System.Drawing.Font("Lucida Console", 9.0f);
            dlg.DisassemblyControl.Services = sc;
            dlg.DisassemblyControl.Model    = new DisassemblyTextModel(program);
            dlg.CodeControl.Model           = GenerateSimulatedHllCode();
        }
Beispiel #6
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);
        }
Beispiel #7
0
 private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (var dlg = new UserPreferencesDialog())
     {
         var sc = new ServiceContainer();
         var cfgSvc = new FakeConfigurationService();
         sc.AddService(typeof(IConfigurationService), cfgSvc);
         var uipSvc = new UiPreferencesService(cfgSvc, new FakeSettingsService());
         uipSvc.Load();
         sc.AddService(typeof(IUiPreferencesService), uipSvc);
         dlg.Services = sc;
         dlg.ShowDialog(this);
     }
 }
        void dlg_Load(object sender, EventArgs e)
        {
            this.dlg.MemoryControl.Services = dlg.Services;
            this.uipSvc = dlg.Services.RequireService<IUiPreferencesService>();
            PopulateStyleTree();

            this.sc = new ServiceContainer();
            var cfgSvc = dlg.Services.RequireService<IConfigurationService>();
            var settingsSvc = dlg.Services.RequireService<ISettingsService>();
            this.localSettings = new UiPreferencesService(cfgSvc, settingsSvc);
            sc.AddService<IUiPreferencesService>(localSettings);
            CopyStyles(uipSvc, localSettings);

            GenerateSimulatedProgram();
            dlg.MemoryControl.Services = sc;
            dlg.MemoryControl.ProgramImage = program.Image;
            dlg.MemoryControl.ImageMap = program.ImageMap;
            dlg.MemoryControl.Architecture = program.Architecture;
            dlg.MemoryControl.Font = new System.Drawing.Font("Lucida Console", 9.0f);
            dlg.DisassemblyControl.StyleClass = UiStyles.Disassembler;
            dlg.DisassemblyControl.Services = sc;
            dlg.DisassemblyControl.Model = new DisassemblyTextModel(program);
            dlg.CodeControl.Model = GenerateSimulatedHllCode();
        }
        void dlg_Load(object sender, EventArgs e)
        {
            this.dlg.MemoryControl.Services = dlg.Services;
            this.uipSvc = dlg.Services.RequireService<IUiPreferencesService>();
            PopulateStyleTree();

            this.sc = new ServiceContainer();
            this.localSettings = new UiPreferencesService(null, null);
            sc.AddService(typeof(IUiPreferencesService), localSettings);
            CopyStyles(uipSvc, localSettings);

            GenerateSimulatedProgram();
            dlg.MemoryControl.ProgramImage = program.Image;
            dlg.MemoryControl.ImageMap = program.ImageMap;
            dlg.MemoryControl.Architecture = program.Architecture;
            dlg.MemoryControl.Font = new System.Drawing.Font("Lucida Console", 9.0f);
            dlg.DisassemblyControl.Model = new DisassemblyTextModel(program);
            dlg.CodeControl.Model = null; /*;*/ 
        }