To get depression you should have either been having a stressful time, less sleep, concentration span decreases due to having a lot on your mind and loosing self esteem due to a recent happening. You should try and get back to being social surround yourself with positive influence from friends and family, get to do fun things you never thought of doing to get your mind of it. Also talk to someone like your best friend to find out how you can manage it.
Sometimes your like runs you instead of you running it. Slow down some. Find your self a good shrink that you feel you can tell anything too. He will help you get to the bottom of the problem. Good Luck!