c# - Encapsulate enum -


i´m trying understand how use enumerations in c#. googled can´t figure out how encapsulate enumeration.

i have class contains enum attribute. how encapsulate attribute can use outside class?

private enum cost { price, diff }; 

you have declare enum:

  public enum cost {      price,      diff    }; 

then use it

  public class myclass {     // property of "cost" type     public cost mycost {       get;       set;      }     ...   } 

Comments