修复加载被禁用打开设置插件加载的Bug,修复书签自定义的添加后删除的Bug。完善书签支持。

This commit is contained in:
寂静的羽夏 2021-09-05 13:16:15 +08:00
parent 829cc70f5d
commit c84e668c76
13 changed files with 243 additions and 66 deletions

View File

@ -243,6 +243,20 @@ namespace Be.Windows.Forms
return true;
}
/// <summary>
/// 获取在指定字节位置的高亮区块
/// </summary>
/// <param name="index"></param>
/// <param name="IsMain"></param>
/// <returns></returns>
public HighlightedRegion GetHighligedRegion(long index, bool IsMain = true)
{
List<HighlightedRegion> highlightedRegions = IsMain ? HighligedRegions : HighlightedRegions;
return highlightedRegions.Find(k => k.Start <= index && k.Start + k.Length >= index);
}
/// <summary>
/// 清空高亮区段
/// </summary>

View File

@ -1,8 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="HexExplorer.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<applicationSettings>
<HexExplorer.Properties.Settings>
<setting name="EmojiFont" serializeAs="String">
<value>Segoe UI Emoji, 7pt</value>
</setting>
</HexExplorer.Properties.Settings>
</applicationSettings>
</configuration>

View File

@ -18,7 +18,7 @@ namespace HexExplorer
if (LicenseManager.UsageMode != LicenseUsageMode.Designtime)
{
Font = UserSetting.UserProfile.ProgramFont;
DataBindings.Add(new Binding("Font", UserSetting.UserProfile, "ProgramFont", true, DataSourceUpdateMode.OnPropertyChanged));
}
}

View File

@ -7,8 +7,6 @@ namespace HexExplorer
public static class Setting
{
public static readonly Binding ProgramFont
= new Binding("Font", UserSetting.UserProfile, "ProgramFont", true, DataSourceUpdateMode.OnPropertyChanged);
public static readonly Binding ProgramFontName
= new Binding("Text", UserSetting.UserProfile.ProgramFont, "Name", true, DataSourceUpdateMode.OnPropertyChanged);
public static readonly Binding StringViewEncoding
@ -72,10 +70,12 @@ namespace HexExplorer
public static readonly Binding HexStringLinePenFore
= new Binding("ForeColor", UserSetting.UserProfile.HexStringLinePen, "Color", true, DataSourceUpdateMode.OnPropertyChanged);
public static readonly Binding BookMarkDefaultColor
= new Binding("ForeColor", UserSetting.UserProfile, "BookMarkDefaultColor", true, DataSourceUpdateMode.OnPropertyChanged);
}
public static readonly Binding LogInfo = new Binding("Text", LoggingLib.Instance, "LogInfo");
public static readonly Binding UseShell = new Binding("Checked", FrmSetting.UseShell, null , true, DataSourceUpdateMode.OnPropertyChanged);
}
}

View File

@ -724,6 +724,7 @@
//
// MenuPlugin
//
this.MenuPlugin.Enabled = false;
this.MenuPlugin.Image = global::HexExplorer.Properties.Resources.plugin;
this.MenuPlugin.Name = "MenuPlugin";
this.MenuPlugin.Size = new System.Drawing.Size(92, 24);
@ -1512,7 +1513,7 @@
this.tbBookMark.Size = new System.Drawing.Size(29, 24);
this.tbBookMark.Tag = "2";
this.tbBookMark.Text = "书签";
this.tbBookMark.Click += new System.EventHandler(this.MIBookMark_Click);
this.tbBookMark.MouseDown += new System.Windows.Forms.MouseEventHandler(this.TbBookMark_MouseDown);
this.tbBookMark.MouseLeave += new System.EventHandler(this.HideToolTipGroup_MouseLeave);
this.tbBookMark.MouseMove += new System.Windows.Forms.MouseEventHandler(this.ShowToolTipGroup_MouseMove);
//
@ -1798,6 +1799,7 @@
this.Controls.Add(MainMenu);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.KeyPreview = true;
this.MainMenuStrip = MainMenu;
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "FrmMain";
@ -1805,6 +1807,8 @@
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMain_FormClosing);
this.Load += new System.EventHandler(this.FrmMain_Load);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmMain_KeyDown);
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.FrmMain_KeyUp);
MainMenu.ResumeLayout(false);
MainMenu.PerformLayout();
this.hexMenuStrip.ResumeLayout(false);

View File

@ -14,7 +14,7 @@ namespace HexExplorer
public partial class FrmMain : FormBase
{
private readonly EditorPageManager pageManager;
private string[] Args;
private readonly string[] Args;
private readonly string EditFileExt = string.Empty;
@ -29,8 +29,10 @@ namespace HexExplorer
private readonly ConstInfo constInfo;
private readonly char[] InvalidFilenameChars = Path.GetInvalidFileNameChars();
private readonly Lazy<List<HexBox.HighlightedRegion>> BookMarkregions = new Lazy<List<HexBox.HighlightedRegion>>();
private readonly WSPlugin pluginManager;
private static readonly MUserProfile mUser = UserSetting.UserProfile;
private readonly List<BookMarkProperty> bookMarks = mUser.MarkProperties;
private Keys keydown = Keys.None;
public FrmMain(string[] args = null)
{
@ -67,6 +69,7 @@ namespace HexExplorer
if (UserSetting.UserProfile.EnablePlugin)
{
MenuPlugin.Enabled = true;
pluginManager = WSPlugin.Instance;
pluginManager.ToHostMessagePipe += PluginManager_ToHostMessagePipe;
WSPlugin.PluginSupportLib.pluginManager = pluginManager;
@ -387,6 +390,16 @@ namespace HexExplorer
#region
private void FrmMain_KeyDown(object sender, KeyEventArgs e)
{
keydown = e.Modifiers;
}
private void FrmMain_KeyUp(object sender, KeyEventArgs e)
{
keydown = Keys.None;
}
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason != CloseReason.WindowsShutDown)
@ -967,18 +980,45 @@ namespace HexExplorer
}
}
private void BookMark(Color color)
{
var hexbox = pageManager.CurrentHexBox;
var region = hexbox.GetHighligedRegion(hexbox.SelectionStart);
if (region == null)
{
var hr = new HexBox.HighlightedRegion
{
Color = color,
Length = hexbox.SelectionLength == 0 ? 1 : hexbox.SelectionLength,
Start = hexbox.SelectionStart
};
hexbox.AddHighligedRegion(hr);
}
else
{
if (hexbox.SelectionLength > 0)
{
if (MessageBox.Show("如果要删除区块,请不要添加选区。如果要删除选区,请点击是,将根据状态栏的位置作为判断依据。",
"提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
{
return;
}
}
hexbox.RemoveHighlightedRegion(region);
}
}
private void MIBookMark_Click(object sender, EventArgs e)
{
int res = BookMarkregions.Value.FindIndex(k => k.IsByteSelected(pageManager.CurrentHexBox.SelectionStart));
if (!pageManager.CurrentHexBox.RemoveHighlightedRegionAt(res))
{
pageManager.CurrentHexBox.AddHighligedRegion(new HexBox.HighlightedRegion
{
Color = Color.AliceBlue,
Length = pageManager.CurrentHexBox.SelectionLength == 0 ? 1 : pageManager.CurrentHexBox.SelectionLength,
Start = pageManager.CurrentHexBox.SelectionStart
});
}
BookMark(mUser.BookMarkDefaultColor);
}
private void TbBookMark_MouseDown(object sender, MouseEventArgs e)
{
var bookmark = bookMarks.Find(k => k.KeyDown == keydown && k.MouseButton == e.Button);
BookMark(bookmark != null ? bookmark.Color : mUser.BookMarkDefaultColor);
}
private void MIAboutThis_Click(object sender, EventArgs e)

View File

@ -135,30 +135,6 @@
<metadata name="MainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="MenuItemSetting.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MenuItemAbout.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MINew.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIOpen.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIOpenProcess.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIS0.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIS1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIExit.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MINew.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
@ -207,21 +183,6 @@
<metadata name="MIInfo.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIGeneral.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIPlugin.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIInfo.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MICalculator.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIAddrConverter.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MICalculator.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
@ -237,6 +198,39 @@
<metadata name="MISponsor.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MINew.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIOpen.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIOpenProcess.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIS0.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIS1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIExit.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIGeneral.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIPlugin.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIInfo.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MICalculator.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIAddrConverter.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="MIAbout.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
@ -281,7 +275,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADQ
DwAAAk1TRnQBSQFMAgEBBAEAAeABBAHgAQQBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
DwAAAk1TRnQBSQFMAgEBBAEAAfgBBAH4AQQBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
AwABIAMAAQEBAAEgBgABIP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AugADQAFwA2IB7wNi
Ae8DQAFwGAAD9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8cAAP2Af8D9gH/A/YB/wP2
Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af9QAAMXASADWQG/

View File

@ -54,6 +54,7 @@ namespace HexExplorer
this.cbEnableString = new System.Windows.Forms.CheckBox();
this.cbLineInfo = new System.Windows.Forms.CheckBox();
this.btnSelTextColor = new System.Windows.Forms.Button();
this.btnBMDColor = new System.Windows.Forms.Button();
this.btnSelBackColor = new System.Windows.Forms.Button();
this.ntScaling = new System.Windows.Forms.NumericUpDown();
this.cbEnablePE = new System.Windows.Forms.CheckBox();
@ -79,6 +80,10 @@ namespace HexExplorer
this.cD = new System.Windows.Forms.ColorDialog();
this.fD = new System.Windows.Forms.FontDialog();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.menustrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
tabGeneral = new System.Windows.Forms.TabPage();
groupBox2 = new System.Windows.Forms.GroupBox();
groupBox1 = new System.Windows.Forms.GroupBox();
@ -98,6 +103,7 @@ namespace HexExplorer
tabOther.SuspendLayout();
this.gpNeedAdmin.SuspendLayout();
this.tabSetting.SuspendLayout();
this.menustrip.SuspendLayout();
this.SuspendLayout();
//
// tabGeneral
@ -147,6 +153,7 @@ namespace HexExplorer
this.btnFont.TabIndex = 0;
this.btnFont.Text = "微软雅黑";
this.btnFont.UseVisualStyleBackColor = true;
this.btnFont.Click += new System.EventHandler(this.BtnFont_Click);
//
// cbEncoding
//
@ -195,6 +202,7 @@ namespace HexExplorer
groupBox1.Controls.Add(this.cbEnableString);
groupBox1.Controls.Add(this.cbLineInfo);
groupBox1.Controls.Add(this.btnSelTextColor);
groupBox1.Controls.Add(this.btnBMDColor);
groupBox1.Controls.Add(this.btnSelBackColor);
groupBox1.Controls.Add(label4);
groupBox1.Controls.Add(this.ntScaling);
@ -210,6 +218,7 @@ namespace HexExplorer
//
// btnStringLine
//
this.btnStringLine.Font = global::HexExplorer.Properties.Settings.Default.EmojiFont;
this.btnStringLine.Location = new System.Drawing.Point(319, 122);
this.btnStringLine.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnStringLine.Name = "btnStringLine";
@ -222,6 +231,7 @@ namespace HexExplorer
//
// btnGroupLine
//
this.btnGroupLine.Font = global::HexExplorer.Properties.Settings.Default.EmojiFont;
this.btnGroupLine.Location = new System.Drawing.Point(319, 93);
this.btnGroupLine.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnGroupLine.Name = "btnGroupLine";
@ -236,13 +246,14 @@ namespace HexExplorer
//
this.btnColInfo.BackColor = System.Drawing.Color.Black;
this.btnColInfo.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnColInfo.Font = global::HexExplorer.Properties.Settings.Default.EmojiFont;
this.btnColInfo.ForeColor = System.Drawing.Color.White;
this.btnColInfo.Location = new System.Drawing.Point(319, 63);
this.btnColInfo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnColInfo.Name = "btnColInfo";
this.btnColInfo.Size = new System.Drawing.Size(43, 25);
this.btnColInfo.TabIndex = 0;
this.btnColInfo.Text = "";
this.btnColInfo.Text = "😀";
this.toolTip.SetToolTip(this.btnColInfo, "更改颜色");
this.btnColInfo.UseVisualStyleBackColor = false;
this.btnColInfo.Click += new System.EventHandler(this.BtnSelectColor_Click);
@ -251,13 +262,14 @@ namespace HexExplorer
//
this.btnLineInfo.BackColor = System.Drawing.Color.Black;
this.btnLineInfo.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnLineInfo.Font = global::HexExplorer.Properties.Settings.Default.EmojiFont;
this.btnLineInfo.ForeColor = System.Drawing.Color.White;
this.btnLineInfo.Location = new System.Drawing.Point(319, 34);
this.btnLineInfo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnLineInfo.Name = "btnLineInfo";
this.btnLineInfo.Size = new System.Drawing.Size(43, 25);
this.btnLineInfo.TabIndex = 0;
this.btnLineInfo.Text = "";
this.btnLineInfo.Text = "😀";
this.toolTip.SetToolTip(this.btnLineInfo, "更改颜色");
this.btnLineInfo.UseVisualStyleBackColor = false;
this.btnLineInfo.Click += new System.EventHandler(this.BtnSelectColor_Click);
@ -341,6 +353,20 @@ namespace HexExplorer
this.btnSelTextColor.UseVisualStyleBackColor = false;
this.btnSelTextColor.Click += new System.EventHandler(this.BtnSelectColor_Click);
//
// btnBMDColor
//
this.btnBMDColor.BackColor = System.Drawing.Color.Black;
this.btnBMDColor.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnBMDColor.ForeColor = System.Drawing.Color.White;
this.btnBMDColor.Location = new System.Drawing.Point(385, 34);
this.btnBMDColor.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnBMDColor.Name = "btnBMDColor";
this.btnBMDColor.Size = new System.Drawing.Size(172, 28);
this.btnBMDColor.TabIndex = 0;
this.btnBMDColor.Text = "默认书签底色";
this.btnBMDColor.UseVisualStyleBackColor = false;
this.btnBMDColor.Click += new System.EventHandler(this.BtnSelectColor_Click);
//
// btnSelBackColor
//
this.btnSelBackColor.BackColor = System.Drawing.Color.Black;
@ -635,6 +661,7 @@ namespace HexExplorer
//
// clbPlugin
//
this.clbPlugin.ContextMenuStrip = this.menustrip;
this.clbPlugin.FormattingEnabled = true;
this.clbPlugin.ItemHeight = 15;
this.clbPlugin.Location = new System.Drawing.Point(20, 55);
@ -716,6 +743,34 @@ namespace HexExplorer
this.fD.ScriptsOnly = true;
this.fD.ShowEffects = false;
//
// menustrip
//
this.menustrip.ImageScalingSize = new System.Drawing.Size(20, 20);
this.menustrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem,
this.ToolStripMenuItem,
this.ToolStripMenuItem});
this.menustrip.Name = "menustrip";
this.menustrip.Size = new System.Drawing.Size(109, 76);
//
// 添加ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "添加ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(108, 24);
this.ToolStripMenuItem.Text = "添加";
//
// 删除ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "删除ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(108, 24);
this.ToolStripMenuItem.Text = "删除";
//
// 清空ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "清空ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(108, 24);
this.ToolStripMenuItem.Text = "清空";
//
// FrmSetting
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
@ -743,6 +798,7 @@ namespace HexExplorer
this.gpNeedAdmin.ResumeLayout(false);
this.gpNeedAdmin.PerformLayout();
this.tabSetting.ResumeLayout(false);
this.menustrip.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -789,5 +845,10 @@ namespace HexExplorer
private System.Windows.Forms.CheckBox cbAdmin;
private System.Windows.Forms.CheckBox cbShellRight;
private System.Windows.Forms.GroupBox gpNeedAdmin;
private System.Windows.Forms.Button btnBMDColor;
private System.Windows.Forms.ContextMenuStrip menustrip;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
}
}

View File

@ -5,6 +5,7 @@ using System.Drawing;
using Microsoft.Win32;
using System.Collections.Generic;
using System;
using System.Text;
namespace HexExplorer
{
@ -14,9 +15,10 @@ namespace HexExplorer
private static FrmSetting frmSetting=null;
public static bool UseShell = false;
private readonly List<WSPlugin.PluginInfo> pluginInfos;
private readonly WSPlugin plugin = WSPlugin.Instance;
private static string app= Application.ExecutablePath;
private string appp = $"\"{app}\" \"%1\"";
private readonly WSPlugin plugin ;
private static readonly string app= Application.ExecutablePath;
private readonly string appp = $"\"{app}\" \"%1\"";
readonly MUserProfile mUser = UserSetting.UserProfile;
public static FrmSetting Instance
{
@ -38,7 +40,6 @@ namespace HexExplorer
InitializeComponent();
//创建绑定,少些重复性代码
DataBindings.Add(BindingEnum.Setting.ProgramFont);
btnFont.DataBindings.Add(BindingEnum.Setting.ProgramFontName);
cbEncoding.DataBindings.Add(BindingEnum.Setting.StringViewEncoding);
ntScaling.DataBindings.Add(BindingEnum.Setting.ScalingPercent);
@ -73,6 +74,7 @@ namespace HexExplorer
btnGroupLine.DataBindings.Add(BindingEnum.Setting.GroupLinePenFore);
btnStringLine.DataBindings.Add(BindingEnum.Setting.HexStringLinePen);
btnStringLine.DataBindings.Add(BindingEnum.Setting.HexStringLinePenFore);
btnBMDColor.DataBindings.Add(BindingEnum.Setting.BookMarkDefaultColor);
cbShellRight.DataBindings.Add(BindingEnum.UseShell);
@ -85,10 +87,10 @@ namespace HexExplorer
gpNeedAdmin.BackgroundImage = Program.AdminIconP;
}
MUserProfile mUser = UserSetting.UserProfile;
var dplugin = mUser.DisableGuid;
if (mUser.EnablePlugin)
{
plugin = WSPlugin.Instance;
pluginInfos = new List<WSPlugin.PluginInfo>();
foreach (var item in plugin.plugins.Value)
{
@ -203,5 +205,14 @@ namespace HexExplorer
}
}
}
private void BtnFont_Click(object sender, EventArgs e)
{
if (fD.ShowDialog()== DialogResult.OK)
{
mUser.ProgramFont = fD.Font;
}
}
}
}

View File

@ -123,6 +123,12 @@
<metadata name="groupBox2.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="groupBox1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="groupBox2.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>167, 17</value>
</metadata>
@ -135,6 +141,12 @@
<metadata name="label3.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="label4.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="label3.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="tabPE.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
@ -144,6 +156,9 @@
<metadata name="tabPlugin.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="menustrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>276, 17</value>
</metadata>
<metadata name="tabOther.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
@ -153,4 +168,7 @@
<metadata name="fD.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>93, 17</value>
</metadata>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>167, 17</value>
</metadata>
</root>

View File

@ -35,6 +35,7 @@ namespace HexExplorer
public static Color DefaultIMAGE_Debug_DIRECTORY_Color = Color.FromArgb(255, 197, 61, 76);
public static Color DefaultIMAGE_dotNetDIRECTORY_Color = Color.FromArgb(255, 66, 202, 166);
public static Color DefaultImage_OtherColor = Color.FromArgb(255, 247, 247, 140);
public static Color DefaultBookMarkDefaultColor = Color.FromArgb(100, 255, 0, 195);
public static PenF DefaultGroupLinePen = new PenF()
{
@ -101,6 +102,7 @@ namespace HexExplorer
private bool enableAdvBookMark;
private List<BookMarkProperty> markProperties;
private bool adminStart;
private Color bookMarkDefaultColor;
#endregion
@ -124,6 +126,7 @@ namespace HexExplorer
HexStringLinePen = DefaultHexStringLinePen;
LineInfoBackColor = DefaultLineInfoBackColor;
ColInfoBackColor = DefaultColInfoBackColor;
BookMarkDefaultColor = DefaultBookMarkDefaultColor;
IMAGE_DOS_HEADER_Color = DefaultIMAGE_DOS_HEADER_Color;
IMAGE_NT_HEADERS_Color = DefaultIMAGE_NT_HEADERS_Color;
IMAGE_FILE_HEADER_Color = DefaultIMAGE_FILE_HEADER_Color;
@ -150,6 +153,15 @@ namespace HexExplorer
#region
public Color BookMarkDefaultColor
{
get => bookMarkDefaultColor; set
{
bookMarkDefaultColor = value;
NotifyPropertyChanged();
}
}
public Font ProgramFont
{
get => programFont;

View File

@ -22,5 +22,14 @@ namespace HexExplorer.Properties {
return defaultInstance;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Segoe UI Emoji, 7pt")]
public global::System.Drawing.Font EmojiFont {
get {
return ((global::System.Drawing.Font)(this["EmojiFont"]));
}
}
}
}

View File

@ -1,5 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HexExplorer.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings />
<Settings>
<Setting Name="EmojiFont" Type="System.Drawing.Font" Scope="Application">
<Value Profile="(Default)">Segoe UI Emoji, 7pt</Value>
</Setting>
</Settings>
</SettingsFile>