I think you may be attacking the problem in the wrong way. Without knowing more about what you are doing here is what I'd suggest:
Create an interface called something like IOutputWriter with a Write(...) method. Then create an implementation for each environment (ConsoleOutputWriter, TextboxOutputWriter, etc...). Each environment can use the appropriate implementation since they know what type of app they are.
| 归档时间: |
|
| 查看次数: |
412 次 |
| 最近记录: |