csuffyy / nmodbus

Automatically exported from code.google.com/p/nmodbus
0 stars 0 forks source link

Make NModbus custom messages .net 2.0 friendly by using a defined delegate instead of Func<> stuff #58

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In our project we still use .net 2.0, we use the 3.5 branch of NModbus and it 
works perfectly except when using custom messages, then the Func<byte[], int> 
RtuBytesRemaining { get; } property of IModbusMessageRtu interface can not be 
used since the Func<> generic is not available on .net 2.0.

This patch defines a delegate with the same signature which is used instead.

I know this patch is not likely to be accepted, but i thought i should report 
it anyway for completeness sake.

Original issue reported on code.google.com by rasmus.toftdahl.olesen on 2 Mar 2011 at 10:50

Attachments:

GoogleCodeExporter commented 9 years ago
If this is the only thing keeping the system from running on 2.0, I think it 
should be considered.  However, I would prefer surrounding the 2.0 specific 
stuff in #ifdef or conditional attributes.  The downside to this is that as far 
as I know, there is not predefined way to detect framework version at 
compile-time.

Original comment by jke...@gmail.com on 8 May 2012 at 3:16

GoogleCodeExporter commented 9 years ago
Hi, thanks for getting back to me on this.

Maybe we could use something like this to get a framework version dependent 
preprocessor directive defined:

http://stackoverflow.com/questions/3436526/detect-target-framework-version-at-co
mpile-time

Original comment by rasmus.toftdahl.olesen on 8 May 2012 at 7:32