Skip to content

Commit 390da79

Browse files
committed
Some cleanup.
1 parent 400085e commit 390da79

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

TokenViewer/TokenForm.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ private static void PopulateGroupList(ListView listView, IEnumerable<UserGroup>
4646
ListViewItem item = new ListViewItem(group.ToString());
4747
item.SubItems.Add(flags.ToString());
4848

49-
if ((flags & GroupAttributes.Enabled) == GroupAttributes.Enabled)
49+
if (flags.HasFlag(GroupAttributes.Enabled))
5050
{
5151
item.BackColor = Color.LightGreen;
5252
}
53-
else if ((flags & GroupAttributes.UseForDenyOnly) == GroupAttributes.UseForDenyOnly)
53+
else if (flags.HasFlag(GroupAttributes.UseForDenyOnly))
5454
{
5555
item.BackColor = Color.LightSalmon;
5656
}
@@ -80,13 +80,13 @@ private void UpdatePrivileges()
8080
bool enabled = false;
8181
string flags = "Disabled";
8282

83-
if ((priv.Attributes & PrivilegeAttributes.Enabled) == PrivilegeAttributes.Enabled)
83+
if (priv.Attributes.HasFlag(PrivilegeAttributes.Enabled))
8484
{
8585
enabled = true;
8686
flags = "Enabled";
8787
}
8888

89-
if ((priv.Attributes & PrivilegeAttributes.EnabledByDefault) == PrivilegeAttributes.EnabledByDefault)
89+
if (priv.Attributes.HasFlag(PrivilegeAttributes.EnabledByDefault))
9090
{
9191
flags = "Default " + flags;
9292
}
@@ -167,12 +167,11 @@ private void UpdateTokenData(ProcessTokenEntry process)
167167

168168
TokenType tokentype = _token.TokenType;
169169

170-
txtTokenType.Text = _token.TokenType.ToString();
170+
txtTokenType.Text = tokentype.ToString();
171171

172-
if (_token.TokenType== TokenType.Impersonation)
172+
if (tokentype == TokenType.Impersonation)
173173
{
174-
SecurityImpersonationLevel implevel = _token.ImpersonationLevel;
175-
txtImpLevel.Text = implevel.ToString();
174+
txtImpLevel.Text = _token.ImpersonationLevel.ToString();
176175
}
177176
else
178177
{

0 commit comments

Comments
 (0)