Tanya,
The sample link I provided give the lines of code that would be needed to select features based on a geometry. There is probably not a sample that is going to specifically meet your needs. You will have to take portions of code from multiple sources and add to it to get what you want. Maybe you need to be more specific with want is the exact portion of the link you provided that you are desiring to reproduce. You need to understand that we can not always provide you with a complete code sample for all your needs though.