我有以下 Windows Phone 7 应用程序的示例代码,我正试图将其转换为 VB.Net 作为起点。像这样的作业:
Loaded += (_, __) => { anonymousMethodBody();}
当我使用 C# 到 VB 转换工具时无法转换。这些应该怎么翻译?
public MainPage()
{
InitializeComponent();
Loaded += (_, __) =>
{
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
cam = new VideoCamera();
cam.Initialized += (___, ____) =>
{
cam.LampEnabled = true;
cam.StartRecording();
};
vCam.SetSource(cam);
new Thread(() =>
{
try
{
var isf = IsolatedStorageFile.GetUserStoreForApplication();
var files = isf.GetFileNames();
foreach (var file in files)
{
Debug.WriteLine("Deleting... " + file);
isf.DeleteFile(file);
}
}
catch (Exception ex)
{
Debug.WriteLine("Error cleaning up isolated storage: " + ex);
}
}).Start();
};
}