private CaseModel ExeEvent_Random_Select_Item() { return(new CaseModel() { NameSign = @"随机选项", ExeEvent = () => { TestEnum[] source = ConvertTool.EnumForeachArray <TestEnum>(); foreach (TestEnum item in source) { Print.WriteLine(string.Format("Name: {0} Value: {1}", item.GetName(), item.GetIntValue())); } Print.WriteLine("随机筛选的值: "); TestEnum random_selitem = RandomData.Item(source); Print.WriteLine(string.Format("Name: {0} Value: {1}", random_selitem.GetName(), random_selitem.GetIntValue())); }, }); }