I have a library that is shared between an ASP.NET and a Winforms application, and there are 2 function implementations within it (should switch depending on a platform it is currently running on).
Unfortunately I cannot change the winforms app to isolate the logic from UI elements (this is how it's done now), so I need to be able to make a switch within the library code depending on environment.
EDIT: Something like this
if(ASP.NET){
myFuncSilent();
} else {
myFuncWithDialogs();
}
myFuncWithDialogs(){
System.Windows.Forms.MessageBox.Show('test');
}
myFuncSilent(){
saveInLog('test');
}