3

I have found mixed opinions regarding this question in answers to other questions, but have not found a question that directly addresses it.

Is it necessary to move the Dispose method, in a winforms generated .Designer.cs file, to the main code file so that the designer will not overwrite changes I have made to the method?

Community
  • 1
  • 1
Alex B
  • 133
  • 4

1 Answers1

10

No, you won't lose it. But move it, the customization isn't discoverable in a file that nobody ever looks at.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • Thanks for the correction. I should have double checked before posting – ChrisF Dec 07 '10 at 23:27
  • I certainly agree with the discoverable aspect of it, I just wondered if moving it was strictly necessary. The evidence further digging has turned up supporting the conclusion that moving it is not necessary is that the Dispose() method appears to be coming from the Windows Forms template file located in \Common7\IDE\ItemTemplates\CSharp\Windows Forms\1033\Form.zip and that the Dispose method is not contained in the Windows Form Designer generated code region of the .Designer.cs file. – Alex B Dec 07 '10 at 23:31