Override of Graphics.DrawLine

后端 未结 2 977
情歌与酒
情歌与酒 2021-01-28 13:16

I seek to @override the DrawLine method of the Graphics class, but I am unsure if this is possible?

I seek to put a validation in

2条回答
  •  隐瞒了意图╮
    2021-01-28 14:00

    It is not possible for normal code to replace method that is not designed to be replaced/overriden.

    You can

    • pre-process (i.e. ILDASM/modify/ILASM) all calling assemblies to use your new method
    • replace System.Drawing assembly with your own
    • use some existing framework that allows to override such methods like Moles or Fakes if you need it for unit testing.

提交回复
热议问题