Custom Control Properties

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rick Mogstad

    #1

    Custom Control Properties

    I have a control that I need to remove some properties from. I have marked
    them obsolete so that the rest of the dev team can continue to work,
    however, if they delete them, it automatically regenerates them in the auto
    generated code. Is there a way to mark them so they dont re-generate those
    properties?

    I dont want to just remove them, because I dont want everyone to have
    compile errors until they are fixed.

    Thanks,

    Rick


  • Armin Zingler

    #2
    Re: Custom Control Properties

    "Rick Mogstad" <Rick.Mogstad@G Mail.NOSPAM.com > schrieb[color=blue]
    > I have a control that I need to remove some properties from. I have
    > marked them obsolete so that the rest of the dev team can continue
    > to work, however, if they delete them, it automatically regenerates
    > them in the auto generated code. Is there a way to mark them so
    > they dont re-generate those properties?
    >
    > I dont want to just remove them, because I dont want everyone to
    > have compile errors until they are fixed.[/color]


    Apply the System.Componen tModel.Designer SerializationVi sibilityAttribu te to
    the property.


    Armin

    Comment

    • Scott Swigart

      #3
      RE: Custom Control Properties

      If you use the Browsable(False ) attribute on the control, it will no longer
      show up in the properties window, and the designer won't generate code for it.

      "Rick Mogstad" wrote:
      [color=blue]
      > I have a control that I need to remove some properties from. I have marked
      > them obsolete so that the rest of the dev team can continue to work,
      > however, if they delete them, it automatically regenerates them in the auto
      > generated code. Is there a way to mark them so they dont re-generate those
      > properties?
      >
      > I dont want to just remove them, because I dont want everyone to have
      > compile errors until they are fixed.
      >
      > Thanks,
      >
      > Rick
      >
      >
      >[/color]

      Comment

      • Phill  W.

        #4
        Re: Custom Control Properties


        "Scott Swigart" <scott@swigartc onsulting.com> wrote in message
        news:96D00D35-0E59-4DAB-B6C0-614213300D08@mi crosoft.com...[color=blue]
        > If you use the Browsable(False ) attribute on the control, it will no
        > longer
        > show up in the properties window, and the designer won't generate code for
        > it.[/color]

        That's what I thought as well - until I found it didn't work and had my
        Developers complaining that 20-odd miscreant properties were
        reappearing in their code!

        Even applying the DefaultValue Attribute didn't quite cut it - properties
        that returned Enum's /still/ got persisted into code.

        The DesignerSeriali sationVisibilit y Attribute is the /only/ way I've found
        to remove them that works reliably.

        Regards,
        Phill W.


        Comment

        • Rick Mogstad

          #5
          Re: Custom Control Properties

          I have Browsable(False ) already (And EditorBrowsable too), but it still
          shows up.


          "Scott Swigart" <scott@swigartc onsulting.com> wrote in message
          news:96D00D35-0E59-4DAB-B6C0-614213300D08@mi crosoft.com...[color=blue]
          > If you use the Browsable(False ) attribute on the control, it will no
          > longer
          > show up in the properties window, and the designer won't generate code for
          > it.
          >
          > "Rick Mogstad" wrote:
          >[color=green]
          >> I have a control that I need to remove some properties from. I have
          >> marked
          >> them obsolete so that the rest of the dev team can continue to work,
          >> however, if they delete them, it automatically regenerates them in the
          >> auto
          >> generated code. Is there a way to mark them so they dont re-generate
          >> those
          >> properties?
          >>
          >> I dont want to just remove them, because I dont want everyone to have
          >> compile errors until they are fixed.
          >>
          >> Thanks,
          >>
          >> Rick
          >>
          >>
          >>[/color][/color]


          Comment

          • Claes Bergefall

            #6
            Re: Custom Control Properties

            How about the DesignerSeriali zationVisibilit y attribute (set to Hidden)

            /claes

            "Rick Mogstad" <Rick.Mogstad@G Mail.NOSPAM.com > wrote in message
            news:eHlQ6f1TGH A.1728@TK2MSFTN GP11.phx.gbl...[color=blue]
            >I have Browsable(False ) already (And EditorBrowsable too), but it still
            >shows up.
            >
            >
            > "Scott Swigart" <scott@swigartc onsulting.com> wrote in message
            > news:96D00D35-0E59-4DAB-B6C0-614213300D08@mi crosoft.com...[color=green]
            >> If you use the Browsable(False ) attribute on the control, it will no
            >> longer
            >> show up in the properties window, and the designer won't generate code
            >> for it.
            >>
            >> "Rick Mogstad" wrote:
            >>[color=darkred]
            >>> I have a control that I need to remove some properties from. I have
            >>> marked
            >>> them obsolete so that the rest of the dev team can continue to work,
            >>> however, if they delete them, it automatically regenerates them in the
            >>> auto
            >>> generated code. Is there a way to mark them so they dont re-generate
            >>> those
            >>> properties?
            >>>
            >>> I dont want to just remove them, because I dont want everyone to have
            >>> compile errors until they are fixed.
            >>>
            >>> Thanks,
            >>>
            >>> Rick
            >>>
            >>>
            >>>[/color][/color]
            >
            >[/color]


            Comment

            Working...