Is there a way I can limit the access of a class or a class object to certain functionality (e.g. writing to the console)?
I currently have a main console project which writes and reads from the console. It also loads various .dll library files (like mini programs) and uses their methods.
I was wondering if there's a way to make those .dll assemblies ask for permission or to restrict their direct access to the console's input/output and make it through e.g. a class mediator/manager.
Say someone is writing an extension (mini program) for my project. I wouldn't want it freely writing to my console application.
P.S. My question doesn't necessarily apply for Console applications only.