Solved

DesignerSerializationVisibility -- what is it exactly?

Posted on 2008-06-25
2
5,467 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

632 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