c# - Windows Forms class partial public issue -
I am using VSTS 2008 + C # + .NET 2.0 to develop the Windows Forms application. I found by default, the new form we created will be marked as partially public.
My concern is whether to expose the public as a security risk? Should we mark it as private? Any effect for efficiency if we mark it as private?
BTW: I personally got the compilation error when marking the class partially in the class here, the compilation error message, any ideas are wrong?
Error 1 elements can be defined in a namespace, which can not be explicitly declared as private, protected or protected internal C: \ FooTest \ Form1.Designer. C
If you define it personal, then what is the purpose of being a class? Nobody will use it outside of that file, even your main program (probably running on program.cs)
partly means that your class was divided, so your form class will be in your Forms file contains more than one component. VS has put the generated code in its own file and the other in its code. You can not terminate partial unless you take all the generated code into a single file, but if you do this and use the form designer to change a label font, then you doom!
Comments
Post a Comment