Ejemplo n.º 1
0
        public DnHexBox(IMenuManager menuManager, IHexEditorSettings hexEditorSettings)
        {
            this.hexEditorSettings = hexEditorSettings;
            SetBinding(Control.FontFamilyProperty, new Binding("FontFamily")
            {
                Source = hexEditorSettings
            });
            SetBinding(Control.FontSizeProperty, new Binding("FontSize")
            {
                Source = hexEditorSettings
            });
            SetResourceReference(Control.BackgroundProperty, HexBoxThemeHelper.GetBackgroundResourceKey(ColorType.HexText));
            SetResourceReference(Control.ForegroundProperty, HexBoxThemeHelper.GetForegroundResourceKey(ColorType.HexText));
            SetResourceReference(HexBox.OffsetForegroundProperty, HexBoxThemeHelper.GetForegroundResourceKey(ColorType.HexOffset));
            SetResourceReference(HexBox.Byte0ForegroundProperty, HexBoxThemeHelper.GetForegroundResourceKey(ColorType.HexByte0));
            SetResourceReference(HexBox.Byte1ForegroundProperty, HexBoxThemeHelper.GetForegroundResourceKey(ColorType.HexByte1));
            SetResourceReference(HexBox.ByteErrorForegroundProperty, HexBoxThemeHelper.GetForegroundResourceKey(ColorType.HexByteError));
            SetResourceReference(HexBox.AsciiForegroundProperty, HexBoxThemeHelper.GetForegroundResourceKey(ColorType.HexAscii));
            SetResourceReference(HexBox.CaretForegroundProperty, HexBoxThemeHelper.GetBackgroundResourceKey(ColorType.HexCaret));
            SetResourceReference(HexBox.InactiveCaretForegroundProperty, HexBoxThemeHelper.GetBackgroundResourceKey(ColorType.HexInactiveCaret));
            SetResourceReference(HexBox.SelectionBackgroundProperty, HexBoxThemeHelper.GetBackgroundResourceKey(ColorType.HexSelection));
            SetResourceReference(Control.FontStyleProperty, HexBoxThemeHelper.GetFontStyleResourceKey(ColorType.HexText));
            SetResourceReference(Control.FontWeightProperty, HexBoxThemeHelper.GetFontWeightResourceKey(ColorType.HexText));

            menuManager.InitializeContextMenu(this, MenuConstants.GUIDOBJ_HEXBOX_GUID, null, new ContextMenuInitializer());

            BytesGroupCount = null;
            BytesPerLine    = null;
            UseHexPrefix    = null;
            ShowAscii       = null;
            LowerCaseHex    = null;
            AsciiEncoding   = null;

            InstallBindings();
        }
Ejemplo n.º 2
0
        public DnHexBox(IMenuManager menuManager, IHexEditorSettings hexEditorSettings)
        {
            this.hexEditorSettings = hexEditorSettings;
            SetBinding(Control.FontFamilyProperty, new Binding("FontFamily") { Source = hexEditorSettings });
            SetBinding(Control.FontSizeProperty, new Binding("FontSize") { Source = hexEditorSettings });
            SetResourceReference(Control.BackgroundProperty, HexBoxThemeHelper.GetBackgroundResourceKey(ColorType.HexText));
            SetResourceReference(Control.ForegroundProperty, HexBoxThemeHelper.GetForegroundResourceKey(ColorType.HexText));
            SetResourceReference(HexBox.OffsetForegroundProperty, HexBoxThemeHelper.GetForegroundResourceKey(ColorType.HexOffset));
            SetResourceReference(HexBox.Byte0ForegroundProperty, HexBoxThemeHelper.GetForegroundResourceKey(ColorType.HexByte0));
            SetResourceReference(HexBox.Byte1ForegroundProperty, HexBoxThemeHelper.GetForegroundResourceKey(ColorType.HexByte1));
            SetResourceReference(HexBox.ByteErrorForegroundProperty, HexBoxThemeHelper.GetForegroundResourceKey(ColorType.HexByteError));
            SetResourceReference(HexBox.AsciiForegroundProperty, HexBoxThemeHelper.GetForegroundResourceKey(ColorType.HexAscii));
            SetResourceReference(HexBox.CaretForegroundProperty, HexBoxThemeHelper.GetBackgroundResourceKey(ColorType.HexCaret));
            SetResourceReference(HexBox.InactiveCaretForegroundProperty, HexBoxThemeHelper.GetBackgroundResourceKey(ColorType.HexInactiveCaret));
            SetResourceReference(HexBox.SelectionBackgroundProperty, HexBoxThemeHelper.GetBackgroundResourceKey(ColorType.HexSelection));
            SetResourceReference(Control.FontStyleProperty, HexBoxThemeHelper.GetFontStyleResourceKey(ColorType.HexText));
            SetResourceReference(Control.FontWeightProperty, HexBoxThemeHelper.GetFontWeightResourceKey(ColorType.HexText));

            menuManager.InitializeContextMenu(this, MenuConstants.GUIDOBJ_HEXBOX_GUID, null, new ContextMenuInitializer());

            BytesGroupCount = null;
            BytesPerLine = null;
            UseHexPrefix = null;
            ShowAscii = null;
            LowerCaseHex = null;
            AsciiEncoding = null;

            InstallBindings();
        }
Ejemplo n.º 3
0
		HexBoxFileTabContentCreator(Lazy<IHexDocumentManager> hexDocumentManager, IMenuManager menuManager, IHexEditorSettings hexEditorSettings, IAppSettings appSettings, Lazy<IHexBoxUndoManager> hexBoxUndoManager) {
			this.hexDocumentManager = hexDocumentManager;
			this.menuManager = menuManager;
			this.hexEditorSettings = hexEditorSettings;
			this.appSettings = appSettings;
			this.hexBoxUndoManager = hexBoxUndoManager;
		}
Ejemplo n.º 4
0
 HexBoxDocumentTabContentCreator(Lazy <IHexDocumentService> hexDocumentService, IMenuService menuService, IHexEditorSettings hexEditorSettings, IAppSettings appSettings, Lazy <IHexBoxUndoService> hexBoxUndoService)
 {
     this.hexDocumentService = hexDocumentService;
     this.menuService        = menuService;
     this.hexEditorSettings  = hexEditorSettings;
     this.appSettings        = appSettings;
     this.hexBoxUndoService  = hexBoxUndoService;
 }
Ejemplo n.º 5
0
 HexBoxFileTabContentCreator(Lazy <IHexDocumentManager> hexDocumentManager, IMenuManager menuManager, IHexEditorSettings hexEditorSettings, IAppSettings appSettings, Lazy <IHexBoxUndoManager> hexBoxUndoManager)
 {
     this.hexDocumentManager = hexDocumentManager;
     this.menuManager        = menuManager;
     this.hexEditorSettings  = hexEditorSettings;
     this.appSettings        = appSettings;
     this.hexBoxUndoManager  = hexBoxUndoManager;
 }
Ejemplo n.º 6
0
 public HexBoxFileTabContent(HexDocument hexDocument, IMenuManager menuManager, IHexEditorSettings hexEditorSettings, IAppSettings appSettings, Lazy<IHexBoxUndoManager> hexBoxUndoManager)
 {
     if (hexDocument == null)
         throw new ArgumentNullException();
     this.hexDocument = hexDocument;
     this.menuManager = menuManager;
     this.hexEditorSettings = hexEditorSettings;
     this.appSettings = appSettings;
     this.hexBoxUndoManager = hexBoxUndoManager;
 }
Ejemplo n.º 7
0
 public HexBoxDocumentTabContent(HexDocument hexDocument, IMenuService menuService, IHexEditorSettings hexEditorSettings, IAppSettings appSettings, Lazy <IHexBoxUndoService> hexBoxUndoService)
 {
     if (hexDocument == null)
     {
         throw new ArgumentNullException(nameof(hexDocument));
     }
     this.hexDocument       = hexDocument;
     this.menuService       = menuService;
     this.hexEditorSettings = hexEditorSettings;
     this.appSettings       = appSettings;
     this.hexBoxUndoService = hexBoxUndoService;
 }
Ejemplo n.º 8
0
 public HexBoxFileTabContent(HexDocument hexDocument, IMenuManager menuManager, IHexEditorSettings hexEditorSettings, IAppSettings appSettings, Lazy <IHexBoxUndoManager> hexBoxUndoManager)
 {
     if (hexDocument == null)
     {
         throw new ArgumentNullException();
     }
     this.hexDocument       = hexDocument;
     this.menuManager       = menuManager;
     this.hexEditorSettings = hexEditorSettings;
     this.appSettings       = appSettings;
     this.hexBoxUndoManager = hexBoxUndoManager;
 }
Ejemplo n.º 9
0
		MemoryToolWindowContentCreator(IWpfCommandManager wpfCommandManager, IThemeManager themeManager, IMenuManager menuManager, IHexEditorSettings hexEditorSettings, Lazy<ITheDebugger> theDebugger, IAppSettings appSettings) {
			this.wpfCommandManager = wpfCommandManager;
			this.themeManager = themeManager;
			this.menuManager = menuManager;
			this.hexEditorSettings = hexEditorSettings;
			this.theDebugger = theDebugger;
			this.appSettings = appSettings;
			this.contents = new TWContent[MemoryWindowsHelper.NUMBER_OF_MEMORY_WINDOWS];
			for (int i = 0; i < this.contents.Length; i++) {
				var tmpIndex = i;
				this.contents[i] = new TWContent(i, () => CreateContent(tmpIndex));
			}
		}
Ejemplo n.º 10
0
 MemoryToolWindowContentProvider(IWpfCommandService wpfCommandService, IMenuService menuService, IHexEditorSettings hexEditorSettings, Lazy <ITheDebugger> theDebugger, IAppSettings appSettings)
 {
     this.wpfCommandService = wpfCommandService;
     this.menuService       = menuService;
     this.hexEditorSettings = hexEditorSettings;
     this.theDebugger       = theDebugger;
     this.appSettings       = appSettings;
     this.contents          = new TWContent[MemoryWindowsHelper.NUMBER_OF_MEMORY_WINDOWS];
     for (int i = 0; i < this.contents.Length; i++)
     {
         var tmpIndex = i;
         this.contents[i] = new TWContent(i, () => CreateContent(tmpIndex));
     }
 }
Ejemplo n.º 11
0
		public MemoryContent(IWpfCommandManager wpfCommandManager, IThemeManager themeManager, IMenuManager menuManager, IHexEditorSettings hexEditorSettings, IMemoryVM memoryVM, IAppSettings appSettings) {
			this.memoryControl = new MemoryControl();
			this.vmMemory = memoryVM;
			this.vmMemory.SetRefreshLines(() => this.memoryControl.DnHexBox.RedrawModifiedLines());
			this.memoryControl.DataContext = this.vmMemory;
			var dnHexBox = new DnHexBox(menuManager, hexEditorSettings) {
				CacheLineBytes = true,
				IsMemory = true,
			};
			dnHexBox.SetBinding(HexBox.DocumentProperty, "HexDocument");
			this.memoryControl.DnHexBox = dnHexBox;
			dnHexBox.StartOffset = 0;
			dnHexBox.EndOffset = IntPtr.Size == 4 ? uint.MaxValue : ulong.MaxValue;

			appSettings.PropertyChanged += AppSettings_PropertyChanged;
			UpdateHexBoxRenderer(appSettings.UseNewRenderer_HexEditor);

			wpfCommandManager.Add(CommandConstants.GUID_DEBUGGER_MEMORY_CONTROL, memoryControl);
			wpfCommandManager.Add(CommandConstants.GUID_DEBUGGER_MEMORY_HEXBOX, memoryControl.DnHexBox);
		}
Ejemplo n.º 12
0
 public HexBoxDocumentTabUIContext(HexDocument hexDocument, IMenuService menuService, IHexEditorSettings hexEditorSettings, IAppSettings appSettings, IHexBoxUndoService hexBoxUndoService)
 {
     this.hexDocument       = hexDocument;
     this.dnHexBox          = new DnHexBox(menuService, hexEditorSettings);
     this.dnHexBox.Document = this.hexDocument;
     this.dnHexBox.InitializeStartEndOffsetToDocument();
     this.scrollViewer = new ScrollViewer {
         Content          = this.dnHexBox,
         CanContentScroll = true,
         HorizontalScrollBarVisibility = ScrollBarVisibility.Auto,
         VerticalScrollBarVisibility   = ScrollBarVisibility.Auto,
         Focusable = false,
     };
     this.appSettings             = appSettings;
     this.hexBoxUndoService       = hexBoxUndoService;
     appSettings.PropertyChanged += AppSettings_PropertyChanged;
     UpdateHexBoxRenderer(appSettings.UseNewRenderer_HexEditor);
     hexBoxUndoService.Initialize(this.dnHexBox);
 }
Ejemplo n.º 13
0
 LowerCaseHexHexBoxCtxMenuCommand(IHexEditorSettings hexEditorSettings)
 {
     this.hexEditorSettings = hexEditorSettings;
 }
Ejemplo n.º 14
0
 UseHexPrefixHexBoxCtxMenuCommand(IHexEditorSettings hexEditorSettings)
 {
     this.hexEditorSettings = hexEditorSettings;
 }
Ejemplo n.º 15
0
		public HexBoxFileTabUIContext(HexDocument hexDocument, IMenuManager menuManager, IHexEditorSettings hexEditorSettings, IAppSettings appSettings, IHexBoxUndoManager hexBoxUndoManager) {
			this.hexDocument = hexDocument;
			this.dnHexBox = new DnHexBox(menuManager, hexEditorSettings);
			this.dnHexBox.Document = this.hexDocument;
			this.dnHexBox.InitializeStartEndOffsetToDocument();
			this.scrollViewer = new ScrollViewer {
				Content = this.dnHexBox,
				CanContentScroll = true,
				HorizontalScrollBarVisibility = ScrollBarVisibility.Auto,
				VerticalScrollBarVisibility = ScrollBarVisibility.Auto,
				Focusable = false,
			};
			this.appSettings = appSettings;
			this.hexBoxUndoManager = hexBoxUndoManager;
			appSettings.PropertyChanged += AppSettings_PropertyChanged;
			UpdateHexBoxRenderer(appSettings.UseNewRenderer_HexEditor);
			hexBoxUndoManager.Initialize(this.dnHexBox);
		}
Ejemplo n.º 16
0
        public MemoryContent(IWpfCommandManager wpfCommandManager, IThemeManager themeManager, IMenuManager menuManager, IHexEditorSettings hexEditorSettings, IMemoryVM memoryVM, IAppSettings appSettings)
        {
            this.memoryControl = new MemoryControl();
            this.vmMemory      = memoryVM;
            this.vmMemory.SetRefreshLines(() => this.memoryControl.DnHexBox.RedrawModifiedLines());
            this.memoryControl.DataContext = this.vmMemory;
            var dnHexBox = new DnHexBox(menuManager, hexEditorSettings)
            {
                CacheLineBytes = true,
                IsMemory       = true,
            };

            dnHexBox.SetBinding(HexBox.DocumentProperty, nameof(vmMemory.HexDocument));
            this.memoryControl.DnHexBox = dnHexBox;
            dnHexBox.StartOffset        = 0;
            dnHexBox.EndOffset          = IntPtr.Size == 4 ? uint.MaxValue : ulong.MaxValue;

            appSettings.PropertyChanged += AppSettings_PropertyChanged;
            UpdateHexBoxRenderer(appSettings.UseNewRenderer_HexEditor);

            wpfCommandManager.Add(CommandConstants.GUID_DEBUGGER_MEMORY_CONTROL, memoryControl);
            wpfCommandManager.Add(CommandConstants.GUID_DEBUGGER_MEMORY_HEXBOX, memoryControl.DnHexBox);
        }
Ejemplo n.º 17
0
 ShowAsciiHexBoxCtxMenuCommand(IHexEditorSettings hexEditorSettings)
 {
     this.hexEditorSettings = hexEditorSettings;
 }