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
  1. Home
  2. General Programming
  3. C#
  4. C# Class question

C# Class question

Scheduled Pinned Locked Moved C#
questioncsharp
2 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.
  • J Offline
    J Offline
    joshp1217
    wrote on last edited by
    #1

    I may be an Idiot for asking this but it is friday and my brain is fried, lol. But in a C# Class can you just declare an Enum? Other Classes will use this single Enum as a standard across the application.

    R 1 Reply Last reply
    0
    • J joshp1217

      I may be an Idiot for asking this but it is friday and my brain is fried, lol. But in a C# Class can you just declare an Enum? Other Classes will use this single Enum as a standard across the application.

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      Yes, you can. For example:

      public class IceCream
      {
      protected IceCream()
      {
      // Protected constructor
      }

      public enum Flavor
      {
      Vanilla = 0,
      Chocolate,
      Strawberry,
      }
      }

      Client classes can then refer to objects of type IceCream.Flavor that could have a possible value of IceCream.Flavor.Vanilla. /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

      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