Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DesignerSerializationVisibility -- what is it exactly?

Posted on 2008-06-25
2
Medium Priority
?
5,662 Views
Last Modified: 2010-04-21
There seems to be very little information
DesignerSerializationVisibility can be:

1) Hidden - The code generator does not produce code for the object.
2) Visible - The code generator produces code for the object.
3) Content - The code generator produces code for the contents of the object, rather than for the object itself.

Please explain to me what the above 3 points mean exactly, and how they will affect the 2 properties below in the code snippet.

Thank you very much for helping a newbie.
[Browsable(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public new Size Size
        {
            get { return base.Size; }
            set { base.Size = value; }
        }
 
        public Color CellColor
        {
            get { return _cellColor; }
            set
            {
                _cellColor = value;
                this.Invalidate();
            }
        }

Open in new window

0
Comment
Question by:yaronusa
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 21866760
If you look at the .designer code, where the control is used, you can see the effect of chaning the designer serialization process.  Normally, control properties are stored in the .designer code.

Example:

            //
            // ReportViewer
            //
            this.ReportViewer.ActiveViewIndex = -1;
            this.ReportViewer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.ReportViewer.DisplayGroupTree = false;
            this.ReportViewer.Dock = System.Windows.Forms.DockStyle.Fill;
            this.ReportViewer.Location = new System.Drawing.Point(0, 0);
            this.ReportViewer.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.ReportViewer.Name = "ReportViewer";
            this.ReportViewer.SelectionFormula = "";
            this.ReportViewer.Size = new System.Drawing.Size(617, 738);
            this.ReportViewer.TabIndex = 0;
            this.ReportViewer.ViewTimeSelectionFormula = "";

If you want a property that doesn't get stored in the .designer file, then you can change the DesignerSerializationVisibility attribute value.
0
 

Author Closing Comment

by:yaronusa
ID: 31470609
Thanks for confirming that... I DID think the designer code should change and it didn't seem to, but I'll play with it and get it to change I'm sure.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Screencast - Getting to Know the Pipeline
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question