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();
};
}