Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. DefaultValue Attribute for System.Collections.ArrayList

DefaultValue Attribute for System.Collections.ArrayList

Scheduled Pinned Locked Moved C#
graphicsdesign
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Christopher Stratmann
    wrote on last edited by
    #1

    I cannot seem to figure it out. The default value is not working because it still comes up in bold in the property window.

          private System.Collections.ArrayList _Test;
          [DefaultValue(null)]
          [Editor(typeof(TestCollectionEditor), typeof(System.Drawing.Design.UITypeEditor))]
          [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
          public System.Collections.ArrayList Test
          {
             get
             {
                if (_Test == null)
                   _Test = new System.Collections.ArrayList();
                return _Test;
             }
             set { _Test = value; }
          }
    

    I have tried.... [DefaultValue("")] [DefaultValue(-1)] Chris

    J 1 Reply Last reply
    0
    • C Christopher Stratmann

      I cannot seem to figure it out. The default value is not working because it still comes up in bold in the property window.

            private System.Collections.ArrayList _Test;
            [DefaultValue(null)]
            [Editor(typeof(TestCollectionEditor), typeof(System.Drawing.Design.UITypeEditor))]
            [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
            public System.Collections.ArrayList Test
            {
               get
               {
                  if (_Test == null)
                     _Test = new System.Collections.ArrayList();
                  return _Test;
               }
               set { _Test = value; }
            }
      

      I have tried.... [DefaultValue("")] [DefaultValue(-1)] Chris

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      What is it you want to happen? Not show up bolded in the properties window of Visual Studio? Or not show up at all in the Visual Studio properties window?

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: Sound The Great Shofar! The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

      C 1 Reply Last reply
      0
      • J Judah Gabriel Himango

        What is it you want to happen? Not show up bolded in the properties window of Visual Studio? Or not show up at all in the Visual Studio properties window?

        Tech, life, family, faith: Give me a visit. I'm currently blogging about: Sound The Great Shofar! The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

        C Offline
        C Offline
        Christopher Stratmann
        wrote on last edited by
        #3

        I dont want it to show up in bold.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups