Solved

DesignerSerializationVisibility -- what is it exactly?

Posted on 2008-06-25
2
5,232 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 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Web Form VB.Net  import CSV 4 36
How can i use linq for parsing string datetime to real datetime? 16 44
Install Problem 13 30
FTP file download using c# 3 23
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

770 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