예제 #1
0
        private void OpenDebuggerWindow(DebuggerViewModel vm)
        {
            vm.Refresh();
            var window = new DebuggerView(vm.ByteProvider)
            {
                DataContext = vm,
                Owner       = this
            };

            window.ShowDialog();
        }
예제 #2
0
        public FormDebuggerEx(IDebuggable debugTarget)
        {
            _binding.RegisterAdapterFactory <Control>(
                arg => new ControlBindingAdapter(arg));
            _binding.RegisterAdapterFactory <ToolStripItem>(
                arg => new ToolStripItemBindingAdapter(arg));

            _dataContext = new DebuggerViewModel(debugTarget, this);
            _dataContext.Attach();
            _dataContext.ShowRequest  += DataContext_OnShowRequest;
            _dataContext.CloseRequest += DataContext_OnCloseRequest;

            InitializeComponent();

            LoadImages();
            dockPanel.DocumentStyle = DocumentStyle.DockingWindow;// .DockingMdi;

            var dasm = new FormDisassembly();
            var memr = new FormMemory();
            var regs = new FormRegisters();
            var bpts = new FormBreakpoints();

            // Mono compatible
            //dasm.Show(dockPanel, DockState.Document);
            //regs.Show(dasm.Pane, DockAlignment.Right, 0.24);
            //memr.Show(dasm.Pane, DockAlignment.Bottom, 0.3);

            regs.Show(dockPanel, DockState.DockRight);
            bpts.Show(dockPanel, DockState.DockRight);
            dasm.Show(dockPanel, DockState.Document);
            memr.Show(dasm.Pane, DockAlignment.Bottom, 0.3);

            regs.Activate();
            dasm.Activate();

            _childs.Add(dasm);
            _childs.Add(regs);
            _childs.Add(memr);
            _childs.Add(bpts);
            dasm.FormClosed += (s, e) => _childs.Remove(dasm);
            regs.FormClosed += (s, e) => _childs.Remove(regs);
            memr.FormClosed += (s, e) => _childs.Remove(memr);
            bpts.FormClosed += (s, e) => _childs.Remove(bpts);

            dasm.Attach(debugTarget);
            regs.Attach(debugTarget);
            memr.Attach(debugTarget);
            bpts.Attach(debugTarget);

            _binding.DataContext = _dataContext;
            Bind();

            KeyPreview = true;
        }
예제 #3
0
        public DebuggerView(DebuggerViewModel viewModel)
        {
            InitializeComponent();

            // This is needed to find the right view to activate when calling the debugger in editor
            Name = DebuggerModule.TagDebuggerModule;

            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                DataContext = viewModel;
            }
        }
        public IActionResult Debugger()
        {
            var viewModel = new DebuggerViewModel
            {
                Terms = CacheService.Get <List <Term> >(Constants.TermCacheKey) ?? new List <Term>(),
                Posts = CacheService.Get <ConcurrentDictionary <string, Post> >(Constants.PostCacheKey) ??
                        new ConcurrentDictionary <string, Post>(),
                Menus = CacheService.Get <ConcurrentDictionary <int, List <MenuItem> > >(Constants.MenuCacheKey) ??
                        new ConcurrentDictionary <int, List <MenuItem> >()
            };

            return(View(viewModel));
        }
예제 #5
0
        public void Initialize()
        {
            _document           = new DocumentModel();
            _debugger           = new DebuggerModel();
            _console            = new ConsoleModel();
            _debugDocumentModel = new DebugDocumentModel();
            _debuggerFlags      = new DebuggerFlagsModel();
            _editorView         = null;
            _editorDebugView    = null;
            _currentView        = _editorView;

            _debuggerViewModel = new DebuggerViewModel(_document, _debugDocumentModel, _console, _debugger, _currentView, _editorView, _editorDebugView, _debuggerFlags);
        }
예제 #6
0
        public Debugger()
        {
            vm          = SP.GetService <ViewModelsService>().Debugger;
            DataContext = vm;

            vm.NewLogEntry += NewLogEntry;

            InitializeComponent();
            tabControl.SelectedIndex = 0;

            logRTB.Font      = new System.Drawing.Font("Consolas", 10);
            logRTB.BackColor = System.Drawing.Color.FromArgb(22, 22, 22);

            variablesRTB.Font      = new System.Drawing.Font("Consolas", 10);
            variablesRTB.BackColor = System.Drawing.Color.FromArgb(22, 22, 22);
        }
예제 #7
0
        public ViewModelsService()
        {
            Jobs       = new();
            Proxies    = new();
            Wordlists  = new();
            Configs    = new();
            Hits       = new();
            OBSettings = new();
            RLSettings = new();
            Plugins    = new();

            ConfigMetadata = new();
            ConfigReadme   = new();
            ConfigStacker  = new();
            ConfigSettings = new();

            Debugger = new();
        }
        private DebuggerViewModel GetViewModel()
        {
            // get active visitor groups
            var user                = this.HttpContext.User;
            var allVisitorGroups    = this._visitorGroupRepository.Service.List();
            var visitorGroupHelper  = new VisitorGroupHelper(this._visitorGroupRoleRepository.Service);
            var activeVisitorGroups = allVisitorGroups
                                      .Where(x => visitorGroupHelper.IsPrincipalInGroup(user, x.Name))
                                      .Select(x => $"'{x.Name}'")
                                      .ToList();

            // compose view model
            var script = activeVisitorGroups.Any()
                ? $"console.log('Active Visitor Groups: ' + {string.Join(", ", activeVisitorGroups)});"
                : "console.log('There are no active Visitor Groups');";
            var viewModel = new DebuggerViewModel
            {
                Script = script
            };

            return(viewModel);
        }
예제 #9
0
 public void LaunchDebugger([FromServices] Func <object, IRootNavigationWindow> winFactory,
                            [FromServices] DebuggerViewModel debuggerViewModel) =>
 winFactory(debuggerViewModel).Show();