You are developing an outofbrowser application by using Silverlight 4. The application contains the following code segment. (Line numbers are included for reference only.)
01 public partial class App : Application
02 {
03 public App()
04 {
05 this.Startup += this.Application_Startup;
06 InitializeComponent();
07 }
08 void Application_Startup(object sender, StartupEventArgs e)
09 {
10 this.RootVisual = new MainPage();
11
12 }
13 }
You need to ensure that when a new version of the application is available, it is automatically installed and the user is notified.
Which code segment should you insert at line 11?
A.
if (this.Install())
{
MessageBox.Show(“Newer version is installed. Please restart the application”);
}
B.
this.InstallStateChanged += (s, args) =>
{
if (this.InstallState == InstallState.Installed)
{
MessageBox.Show(“Newer version is installed. Please restart the application”);
}
};
this.Install();
C.
this.CheckAndDownloadUpdateCompleted += (s, args) =>
{
if (args.UpdateAvailable)
{
MessageBox.Show(“Newer version is installed. Please restart the application”);
}
};
this.CheckAndDownloadUpdateAsync();
D.
this.CheckAndDownloadUpdateCompleted += (s, args) =>
{
if (this.IsRunningOutOfBrowser)
{
MessageBox.Show(“Newer version is installed. Please restart the application”);
}
};
this.CheckAndDownloadUpdateAsync();