[Mono-dev] Please, share your .Net1.1 and 2.0 support and #if directives experience

Francisco Figueiredo Jr. fxjrlists at yahoo.com.br
Sun Feb 12 11:13:28 EST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rodrigo B. de Oliveira wrote:
> On 2/10/06, Francisco Figueiredo Jr. <fxjrlists at yahoo.com.br> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>>
>>
>> Hi all,
>>
> 
> Hey!
> 

Hi Rodrigo!

>> ...
> 
> We've been using #if directives with success for some time now for the
> db4o code base. The main benefit is that the code is always where you
> expect it to be.
> 
> For complex scenarios we use a mix of partial classes and #if
> directives, for instance:
> 
> // Baz.cs
> namespace Foo.Bar
> {
> #if NET_2_0
> partial
> #endif
>     class Baz
>     {
>          ... // code for all platforms goes here
>     }
> }
> 
> // Baz_2.cs
> namespace Foo.Bar
> {
> #if NET_2_0
>     partial class Baz
>     {
>        // Net 2 specific code here
>     }
> #endif
> }
> 
> I would recommend against using #if directives inside a method body,
> it's much better to have two versions of the method using 'Extract
> Method' as appropriate to share functionality.
> 


Thanks Rodrigo!

Your ideas were very insightful!

> Rodrigo
> 
> PS: E aê, Chicão??!!! :)
> 

Sou eu mesmo rapaz!! Beleza??
Comandando na db4o? :)

- --
Regards,

Francisco Figueiredo Jr.
http://fxjr.blogspot.com
Npgsql Lead Developer
http://www.pgfoundry.org/projects/npgsql
MonoBrasil Project Founder Member
http://monobrasil.softwarelivre.org


- -------------
"Science without religion is lame;
religion without science is blind."

                  ~ Albert Einstein
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEVAwUBQ+9ep/7iFmsNzeXfAQIcZgf+M9uteDcAiGPDhDMpCk41cnoPoAsOmwPr
ZwSddzWvtme/GOo3Ioc3fOrahqyNcv48ZKjmCTCAJ/BoBlrIZRwXOLYUp8RFSo0t
biuBm2JQkFarj02wvCFq480Pm8ehGtSjncotqWOo9nxj3ibO5KSO8hN7wXkbl7yX
ShMFLLSxkyN5tamZL1CtNvCWOMrklIN/aauggsV9yup85go5hxTYBfO29yzONVCI
6kfczKQkkOlNK7V/vUp8ivSmLbAH9g1PCtu0hxg5g0wiAoYn3gGRL98TtvbDDwom
xqVF0xV6e792Syf/BGRwq6km4XaJtRSjPqg72mx+SpQfv74zh9QRcg==
=4Y4W
-----END PGP SIGNATURE-----

		
_______________________________________________________
Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora!
http://br.acesso.yahoo.com



More information about the Mono-devel-list mailing list