Example #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();
        }
Example #2
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;
		}
Example #3
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;
 }
		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));
			}
		}
Example #5
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);
		}
Example #6
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);
		}