Click here to Skip to main content
15,892,298 members

Comments by Kelqualyn (Top 11 by date)

Kelqualyn 1-Nov-11 2:44am View    
Deleted
An exception thrown inside Singletin's .ctor will be thrown on type initialization (instead of first access to Instance property and even if you will never use it) and wrapped into TypeInitializationException. Alternative 6 solves that without any performance loss.
Kelqualyn 6-Sep-11 0:33am View    
Deleted
Reason for my vote of 5
It hard to track down.
IDisposable and using statement us MUST HAVE for unmanaged classes, used from managed code.
Kelqualyn 23-Aug-11 4:34am View    
Deleted
Reason for my vote of 4
Interesting, but too slow.
Slow methods are:
GetProperties()
GetCustomAttributes()
SetValue()
Can be rewritten using LCG API (or LINQ.Expressions) and delegate cache.
Kelqualyn 5-Aug-11 2:57am View    
Deleted
Look at next post :-)
Kelqualyn 4-Aug-11 15:56pm View    
Deleted
Try to convert step-by-step instead of direct conversion.
Every enum is derived from simple numeric type. Default is System.Int32, but you can specify other (e.g. SByte) in enum declaration.
If you want to convert something to enum type, convert it to that enum's base type. And only than convert value to enum type.
Also, you don't need to construct IfThenElse expression. You can just make different expression for enum type. (If condition can be evaluated at expression construction time, use it.)