Skip to content

Commit 1ddbb20

Browse files
author
Steve Syfuhs
committed
Handle label prefix
1 parent 6b9af54 commit 1ddbb20

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Samples/KerbDumpCore/MessageTreeView.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,26 @@ item.OwnerItem is ToolStripItem parentItem &&
144144
}
145145
}
146146

147-
if (!string.IsNullOrWhiteSpace(text) && text.StartsWith("Data = "))
147+
if (!string.IsNullOrWhiteSpace(text))
148148
{
149-
text = text["Data = ".Length..];
149+
foreach (var prefix in LabelPrefixes)
150+
{
151+
if (text.StartsWith(prefix))
152+
{
153+
text = text[prefix.Length..];
154+
break;
155+
}
156+
}
150157
}
151158
}
152159

160+
private static readonly IEnumerable<string> LabelPrefixes = new[]
161+
{
162+
"Data = ",
163+
"Value = ",
164+
"Cipher = "
165+
};
166+
153167
private void OnClickDecodeAsAdWin2kPac(object sender, EventArgs e)
154168
{
155169
ParseNode(sender, out string text, out TreeNode parentNode);

0 commit comments

Comments
 (0)