public static bool ToProtoData <T>(this List <T> list) { string[] array = typeof(T).ToString().Split(new char[] { '.' }); string text = array[array.Length - 1]; string text2 = XUtility.GetPath() + text + ".data"; if (File.Exists(text2)) { File.Delete(text2); } using (Stream stream = File.OpenWrite(text2)) { Serializer.Serialize <List <T> >(stream, list); stream.Close(); } return(true); }