المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Partial class: is this a bug?



C# Programming
03-03-2013, 09:54 AM
1. Create a new VS windows form application.
2. Add a button to it.
3. Double click the button to add the click event.
4. Add a new class to the project. Change its declaration and make it a partial class using the same name as the main form.
5. Move the button click event into the partial class.
6. Go back to the main form and double click the button so that it opens the click event in the code ********

If, like my VS (2012) you'll find it doesn't actually open the event code. In fact, like mine, you'll probably find it places the cursor where the code used to be in the main form. In other words, it doesn't jump to the code in the other source file where you created the partial class and copied the code to. It also does the same in VS2008.

If it's a bug, is there a workaround?
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.