Simon Taylor - .Net developer, Cheltenham

My record of coding problems solved and new things discovered

Creating classes at runtime

clock June 14, 2009 21:55 by author Simon

I've been working on an application that has a number of forms that need to be laid out based on configuration data in the database, this enables the application to meet the requirements of many different customers. Laying out the forms based on the configuration data is relatively trivial - it is just a matter of writing the code that normally ends up in the .designer file. However, because there could be any number of controls on the form, binding an object to them is a little more tricky. I approached this problem by creating a class that describes a control that will added to the form together with a boolean, integer and string value field that is used to initialise the control and capture the users input based on the type of control. I had a list of these objects representing all of the controls that needed to be rendered on the form, to bind the controls to these objects, I needed an adapter which I created at runtime.More...

Currently rated 2.0 by 1 people

  • Currently 2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Encryptor

clock June 14, 2009 20:54 by author Simon

I've written an encryption utility that I find quite useful. There is nothing special about the code that does the encryption, but I have given it a command line interface and kept the actual encryption logic in a separate assembly which can be added to other applications. What I use this for is to manually encrypt data which I then put in a database which can then be decrypted by my application by adding a reference to the dll which has the encryption logic. More...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


A Stacked Bar Chart Silverlight control

clock May 3, 2009 11:01 by author Simon

The Silverlight Toolkit provides developers and designers with a whole host of different controls that don't come as standard. Amongs other things it contains charting controls for creating bar charts, pie charts and line graphs etc. I recently had a requirement for a stacked bar chart which unfortunately is one of the few types of chart that isn't supported out of the box. However, after reading a series of posts written by Jafar Husain and taking a look at the toolkit source code I realised that I could create a stacked bar chart relatively easily myself - despite having only limited knowledge of Silverlight. At this point I have to appologise to Jafar - I asked his advice via his blog and he responded with a very comprehensive description of how he would go about tackling this problem. Jafar's approach would have produced a much more complete and flexible solution however, it was overkill for what I needed and I had to get something put together as quickly as possible, so I took an (arguably) more hacky approach. More...

Currently rated 5.0 by 4 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


IronPython - a configuration language

clock April 8, 2009 19:35 by author Simon

I had a requirement to create a state machine for a product at work. The product is a project management tool and therefore has the concept of a job which based on the users actions moves from one state to another. There was also the additional requirement that the state machine should be configurable by/for different customers. Esentially, the state machine is a large flow diagram but the implementation needed to allow for completely ripping up the first customers flow diagram and replacing it with a completely different one for the next customer.More...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


About the author

Simon is Head of Engineering at Trigger Software, Cheltenham, UK. He is primarily a .Net developer although sometimes has to turn his hand to other technologies such as Java and Flex. Contact me.

Discount ASP

Sign in