Skip to content

Commit

Permalink
Add PropertyExists
Browse files Browse the repository at this point in the history
  • Loading branch information
pardeike committed Jan 24, 2020
1 parent 798915f commit 687ed73
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Harmony/Tools/Traverse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,15 @@ public List<string> Methods()
///
public bool FieldExists()
{
return _info != null;
return _info != null && _info is FieldInfo;
}

/// <summary>Checks if the current traverse instance is for a property</summary>
/// <returns>True if its a property</returns>
///
public bool PropertyExists()
{
return _info != null && _info is PropertyInfo;
}

/// <summary>Checks if the current traverse instance is for a method</summary>
Expand Down

0 comments on commit 687ed73

Please sign in to comment.