8,757
社区成员
发帖
与我相关
我的任务
分享
public class Example
{
[FlagsAttribute]
enum Colors { Red = 1, Green = 2, Blue = 4, Yellow = 8 };
public static void Demo(System.Windows.Controls.TextBlock outputBlock)
{
Colors myOrange = (Colors)Enum.Parse(typeof(Colors), "Red, Yellow", true);
outputBlock.Text += String.Format("The myOrange value {1} has the combined entries of {0}",
myOrange, Convert.ToInt64(myOrange)) + "\n";
}
}