Output: Prepend fields, events, properties and parameter names using reserved C# keywords with @
This commit is contained in:
@@ -29,6 +29,9 @@ namespace Il2CppInspector.Reflection {
|
||||
// Name of the member
|
||||
public virtual string Name { get; protected set; }
|
||||
|
||||
// Name of the member with @ prepended if the name is a C# reserved keyword
|
||||
public string CSharpSafeName => Constants.Keywords.Contains(Name) ? "@" + Name : Name;
|
||||
|
||||
// For top-level members in an assembly (ie. non-nested types)
|
||||
protected MemberInfo(Assembly asm) => Assembly = asm;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user