C#: Sanitize field and event names (#70)
This commit is contained in:
@@ -28,8 +28,8 @@ 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 virtual string CSharpName => Constants.Keywords.Contains(Name) ? "@" + Name : Name;
|
||||
// Name of the member with @ prepended if the name is a C# reserved keyword, plus invalid characters substituted
|
||||
public virtual string CSharpName => Constants.Keywords.Contains(Name) ? "@" + Name : Name.ToCIdentifier();
|
||||
|
||||
// For top-level members in an assembly (ie. non-nested types)
|
||||
protected MemberInfo(Assembly asm) => Assembly = asm;
|
||||
|
||||
Reference in New Issue
Block a user