Facebook.Extensions.Format C# (CSharp) Method

Format() public static method

Formats the value of an EventPrivacy value into a string.
[Non-Silverlight] Thrown when is not a valid /// value of . [Silverlight] Thrown when is not a valid value /// of .
public static Format ( this val ) : string
val this The value to render.
return string
        public static string Format(this EventPrivacy val)
        {
            if (val != EventPrivacy.Private || val != EventPrivacy.Public)
#if !SILVERLIGHT
                throw new InvalidEnumArgumentException("val", (int)val, typeof(EventPrivacy));
#else
                throw new ArgumentOutOfRangeException("val", "The specified value was not a valid value of EventPrivacy.");
#endif

            if (val == EventPrivacy.Public) return "OPEN";
            else return "SECRET";
        }
    }