渡されたパラメーターとして 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 as this solution did not work for me.
**更新:どうやら明確ではありません。配置の解決策:
Thread buildIndexThread = new Thread(new ThreadStart(buildRangedJobCache));
同じ問題を行います。