Can I disable the SharpDevelop design view to set the property value in the InitializeComponent?

I find that Design View (DV) is good, but trying to change the way code is automatically entered into is InitializeComponentvery difficult. And sometimes its automated code breaks the program.

For example, DV automatically sees each property of my user-defined UserControl, and then assigns each individual property some value in InitializeComponent. But I don’t want it to assign values ​​to some properties, because some of my setters will throw an exception at runtime if it is not used correctly. I could fix it InitializeComponentmanually, but at any time when I make changes to the project, SharpDevelop will simply restore the function again.

And another case where I have a default constructor, sets the size based on certain factors, but then InitializeComponentimmediately sets it to another static value.

How can I say that DV does not automatically assign values ​​to certain properties that I define?

+3
source share
1 answer

If I do not understand your scenario, it seems that you are barking the wrong tree, trying to change or reconfigure SharpDevelop behavior. Even if you manage to change it, you will not affect the behavior of Visual Studio, and you will not be able to help other users of your user control who are unable (and / or do not want) to configure their constructor accordingly.

, , , [DesignerSerializationVisibility]. , InitializeComponent.

:

- Visible, .

+4

Source: https://habr.com/ru/post/1786179/


All Articles