我正在尝试在其他类的方法中引用我的公共类属性,但我不能正确地执行它。有没有人可以帮忙?它是 ExtractData( Event special.Day ) 部分。
public static List<Event> ExtractData(Event special.Day)
{
int intChosenDay = special.Day;
StreamReader textIn =
new StreamReader(
new FileStream(path, FileMode.OpenOrCreate, FileAccess.Read));
//create the list
List<Event> events = new List<Event>();
string[] lines = File.ReadAllLines(path);
for (int index = 4; index < lines.Length; index += 5)
{
Event special = new Event();
special.Day = Convert.ToInt32(lines[index - 4]);
special.Time = (lines[index - 3]);
special.Price = Convert.ToDouble(lines[index - 2]);
special.StrEvent = lines[index - 1];
special.Description = lines[index];
events.Add(special);
}
textIn.Close();
return events;
}