static public T RandomForList <T>(List <T> values) { FisherRandom random = new FisherRandom(); int index = random.GetRandomNumber(values.Count); return(values[index]); }
/// <summary> /// 获取数组里面的随机内容 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="array"></param> /// <returns></returns> static public T RandomForArray <T>(T[] values) { FisherRandom random = new FisherRandom(); int index = random.GetRandomNumber(values.Length); return(values[index]); }