locked
Enum problem RRS feed

  • Question

  • User-1706989909 posted

    Hi All,

    public enum ActionOn
    {
    Target = 0,
    Source
    }

     public ActionOn actionOn { get; set; }

    Now actionOn if assaigned with 1 it must return Source. How shall I achieve it?

    Kindly help me.

    Regards

    Shilpa

    Saturday, September 20, 2014 9:09 AM

Answers

  • User1428246847 posted

    Below returns the Name of the enumvalue if the variable actionOn

    string name = Enum.GetName(typeof(ActionOn), actionOn);

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 21, 2014 3:30 PM