pardeike / Harmony

A library for patching, replacing and decorating .NET and Mono methods during runtime
https://www.patreon.com/pardeike
MIT License
5.16k stars 486 forks source link

IReadOnly<T> class for read-only all propertiest of type T #541

Closed BQFiruz closed 1 year ago

BQFiruz commented 1 year ago

Hello I have been looking for some time to add the possibility to make all properties of an object read-only It was possible to make all fields read-only in typescript and it made me double check that I got to know your project and thank you for that and I was able to do this using your project. the folowing url is my solusion for this problem:

https://stackoverflow.com/questions/75731628/what-is-the-best-way-to-write-a-class-with-editable-properties-that-becomes-read

now ; Its posible that create a project for use Harmony for implement another features of langues

pardeike commented 1 year ago

This seems like a C# design problem. Nothing Harmony can or should be used for. Harmony is low level hacking and if you start with that you can of course go around any protection by using reflections on your object that's suppose to not change.