http://nullpro.info/2013/sozdaem-sobstvennoe-sobytie-v-c/