vendredi 31 mars 2017

Access to not defined instance of IDisposable into "using" statement

I have this piece of code:

using(var a = myFunction()){

    a.Process();

}

There is some way to reference not defined instances into the using statement?

I mean, to write some like:

using(myFunction()){

    [Reflection?, another stuff?][0].Process();

}

Some clue?





Aucun commentaire:

Enregistrer un commentaire