I’ve some library code that is used by both console and WPF apps. In the library code, there are some Console.Read() calls. I only want to do those input reads if the app is a console app not if it’s a GUI app – how to tell in the dll if the app has a console?
I’ve some library code that is used by both console and WPF apps. In
Share
In the end I did as follows:
Following thekips advice I added a delegate member to library class to get user validation – and set this to a default implimentation that uses above to check if theres a console and if present uses that to get user validation or does nothing if not (action goes ahead without user validation). This means:
Thanks to all who replied.