Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc520964

Browse files
jichulujeremy-visionaid
authored andcommitted
addEscapedControl for display name on tree view
1 parent87a4d1c commitc520964

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

‎StructuredStorageExplorer/MainForm.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private void RefreshTree()
125125

126126
if(cfis notnull)
127127
{
128-
TreeNoderoot=treeView1.Nodes.Add(cf.EntryInfo.Name);
128+
TreeNoderoot=treeView1.Nodes.Add(cf.EntryInfo.Name.WithEscaped());
129129
root.ImageIndex=0;
130130
root.Tag=newNodeSelection(null,cf.EntryInfo);
131131

@@ -167,7 +167,7 @@ private static void AddNodes(TreeNode node, Storage storage)
167167
{
168168
foreach(EntryInfoiteminstorage.EnumerateEntries())
169169
{
170-
TreeNodechildNode=node.Nodes.Add(item.Name);
170+
TreeNodechildNode=node.Nodes.Add(item.Name.WithEscaped());
171171
childNode.Tag=newNodeSelection(storage,item);
172172

173173
if(item.TypeisEntryType.Storage)
@@ -371,7 +371,7 @@ private void TreeView1_MouseUp(object sender, MouseEventArgs e)
371371
hexEditor.ByteProvider=null;
372372
}
373373

374-
propertyGrid1.SelectedObject=nodeSelection.EntryInfo;
374+
propertyGrid1.SelectedObject=nodeSelection.EntryInfo.WithEscaped();
375375
}
376376
catch(Exceptionex)when(exisIOException orUnauthorizedAccessException orFileFormatException)
377377
{

‎StructuredStorageExplorer/Utils.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespaceStructuredStorageExplorer;
1+
usingOpenMcdf;
2+
3+
namespaceStructuredStorageExplorer;
24

35
staticclassUtils
46
{
@@ -43,4 +45,22 @@ public static DialogResult InputBox(string title, string promptText, ref string
4345
value=textBox.Text;
4446
returndialogResult;
4547
}
48+
49+
publicstaticEntryInfoWithEscaped(thisEntryInfoentry)=>entrywith{Name=EscapedControl(entry.Name),Path=EscapedControl(entry.Path)};
50+
51+
publicstaticstringWithEscaped(thisstringentry)=>EscapedControl(entry);
52+
53+
privatestaticstringEscapedControl(strings)
54+
{
55+
if(string.IsNullOrEmpty(s))returns;
56+
varsb=newSystem.Text.StringBuilder();
57+
foreach(charcins)
58+
{
59+
if(char.IsControl(c))
60+
sb.Append($"\\u{((int)c):x4}");
61+
else
62+
sb.Append(c);
63+
}
64+
returnsb.ToString();
65+
}
4666
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp