关于delegate() 的语法
代码片断
public class Splasher
{
private static Form m_SplashForm = null;
private static ISplashForm m_SplashInterface = null;
private static Thread m_SplashThread = null;
private static string m_TempStatus = string.Empty;
/// <summary>
/// 显示启动画面
/// </summary>
public static void Show(Type splashFormType)
{
if (m_SplashThread != null)
return;
if (splashFormType == null)
{
throw (new Exception("必须设置启动窗体"));
}
m_SplashThread = new Thread(
new ThreadStart(delegate()
{
CreateInstance(splashFormType);
Application.Run(m_SplashForm);
}
));
m_SplashThread.IsBackground = true;
m_SplashThread.SetApartmentState(ApartmentState.STA);
m_SplashThread.Start();
}
这段代码是什么意思,没有见过delegate的这种用法,多谢大虾们
delegate()
{
CreateInstance(splashFormType);
Application.Run(m_SplashForm);
}