Hi
I've been trying to find a way of creating the IDisposable pattern using
CodeDom without resorting to literal statements. I can create the
equivalent with a CodeTryCatchFinallyStatement, but it's not nice to look at
especially when you have nested disposable objects, e.g. connection >
command dataAdapter.
I'm probably missing something, so if anyone can point me in the right
direction it would be greatly appreciated.
Also, any idea why CodeBinaryOperatorType doesn't have ValueInequality? It
just seems like such a simple and obvious thing to have.
How I want it...
if ( oracleDataAdapter != null )
{
//Do stuff
}
Instead the code has to look like this (ick!)...
if ( ( oracleDataAdapter == null ) == false )
{
//Do stuff
}
or perhaps (again, ick!)...
if ( ( oracleDataAdapter == null ) )
{
//Do nought
}
else
{
//Do stuff
}
Again, I've probably missed something and even if I haven't, it's no biggy,
but it would be nice to understand why.
Thanks
Glenn