Category Archives: Software Development

Misadventures with xsd.exe


I am writing a reporting tool and I got the required schema as a set of xsd files. Open the Visual Studio command line and run xsd.exe on the outer schema specifying /c to build classes. I get this nice … Continue reading

Posted in Software Development | Tagged , , | Leave a comment

JavaScript Leftovers


The script bundler in MVC 4 can be a good or a bad thing. When you direct it to load a js file with wildcards you could get more than you want. I was working on a project with out … Continue reading

Posted in Software Development | Tagged , , | Leave a comment

Implicit Value Assignment Pitfalls in VB.net


Look at the following block of VB.net code. For i = 1 To 10 Dim isEven As Boolean     If i Mod 2 = 0 Then      isEven = True     End If     Console.WriteLine(“{0} {1}”, i, isEven) Next Do you think the value isEven will be be correct? If you said yes you are incorrect. The following block of code will return … Continue reading

Posted in Software Development | Tagged , | Leave a comment

ControlDesigner


ControlDesigners control the design time experience of controls. For example they lock the textbox height unless you enable multiline.  You can do many things with your custom control by using a custom controldesigner. There is a great tutorial on ControlDesigners … Continue reading

Posted in Software Development | Leave a comment

Array that acts like Dictionary(of string,string)


This is a manually built Dictionary using a pair of arrays Dim x As String = “GE” Dim Keys() As String = {“GT”, “LT”, “EQ”, “NE”, “GE”, “LE”} Dim Values() As String = {“>”, “<“, “=”, “<>”, “>=”, “<=”} Dim selectedIndex As Int32 = Array.IndexOf(Keys, x) Dim selectedValue As String = Values(selectedIndex) This gives you the same lookup features as as a KeyValue dictionary of strings does. The performance gains are neglible though and it is messy code. … Continue reading

Posted in Software Development | Leave a comment