我正在尝试使用 SelectionRange S 作为传入参数调用 buildRangedJobCache,但是编译器(visual studio 2010)给出了错误:Method Name Expected
下面是给出问题的调用:
private void retrieveSeveralDaysJobs(SelectionRange S)
{
ignoreUpdates = false;
this.SetStatus(DataLogUIStrings.strRetrievingJobInformation);
Thread buildIndexThread = new Thread(new ThreadStart(buildRangedJobCache(S)));
buildIndexThread.Priority = ThreadPriority.Lowest;
buildIndexThread.Start();
}
这是函数 buildRangedJobCache(SelectionRange S):
private void buildRangedJobCache(SelectionRange S)
{
this.Cursor = Cursors.AppStarting;
try
{
if (DataStore == null)
{ throw new Exception("Error: DataStore is null, Unable to retrieve jobs."); }
lock (((ICollection)jobs).SyncRoot)
{
for (DateTime Day = S.Start; Day <= S.End; Day.AddDays(1))
{
this.RangeJobs.AddRange(DataStore.GetJobsListForDay(JobDateToDisplay.GetValueOrDefault(DateTime.Today)));
}
}
this.SetStatus(string.Format(DataLogUIStrings.strRetrievedSummaryInformation, this.jobs.Count));
}
catch (Exception e)
{
Log.Write(e);
}
this.Cursor = Cursors.Default;
}
我也链接到这里:Delegate: Method name expected error 因为这个解决方案对我不起作用。
**更新:显然还不清楚,解决方案:
Thread buildIndexThread = new Thread(new ThreadStart(buildRangedJobCache));
做同样的问题。