Losing data from Designer.cs file when opening form - C # Windows Form Application

0

I have a custom editor that adds buttons to a collection. This procedure is working fine, the data is serialized in the Designer file, but when I reopen the form or do a project build, the data that was in the Designer disappears.

What before in the Designer file was serialized as:

// 
// MyForm
// 
this.buttons.Add(this.button1);
this.buttons.Add(this.button2);
this.buttons.Add(this.button3);

The self generated code snippet disappears when the form is reopened or when I build the project:

// 
// myForm
// 

Note: Only the variable I have the custom editor.

As it seems to me, this seems like a deserialization problem. I've tried creating my own serializer (unsuccessfully), but maybe there could be a simpler solution.

    
asked by anonymous 07.12.2016 / 12:12

0 answers