如何避免使用带有C#的开关盒(带有dll函数)>

问题描述 投票:0回答:1

我使用DLL通过Microchip与自举程序进行通信,并且使用了DLL的许多功能。

Swicht(DLL Function)
case: Readbyte
    MC2211.readbyte(intptr DeviceHabdle, unit number Of Bytes, ref Data)
case : Writebyte
    MC2211.readbyte(intptr DeviceHabdle, unit number Of Bytes, ref Data)

但是这种结构违反了开闭原则。

我使用DLL通过Microchip与自举程序进行通信,并且我使用了dll的许多功能。 Swicht(DLL函数)情况:Readbyte MC2211.readbyte(intptr DeviceHabdle,字节的单位数量,...

c# dll
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.