Test your knowledge

  1. You are developing a Silverlight 4 application that uses the isolated storage. The application you just created is a module of a bigger application already running. Your newly created application will need 6 MB of free space in the isolated storage. You need to ensure that the minimum amount of space needed to save those 6 MB is requested. Which code snippet should you use?

    a. Using(IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) { isf.IncreaseQuotaTo(6291456) });

    b. Using(IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) { isf.IncreaseQuotaTo(isf.UsedSize+6291456) });

    c. Using(IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) { isf.IncreaseQuota (6291456) });

    d. Using(IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) { isf.IncreaseQuotaTo(isf.AvaliableSpace+6291456) });

  2. You are developing an image gallery application using Silverlight 4. Your application is running in browser. You need to provide a user with a way to upload images from his computer to the application. Which action should you perform?

    a. Use the SaveFileDialog class.

    b. Call a JavaScript function from the application that will handle the image uploading logic.

    c. Use the OpenFileDialog class.

    d. Use the Environment.GetFolderPath method of the CreateFileDialog class.

  3. You are developing a Silverlight 4 application. The application contains a Grid element. You wish to create a contextual menu on the grid headers that will appear when a user right-clicks on them. You handle the RightMouseButtonDown event of the Grid element to create the ContextMenu object and its items. When you test the application, you discover that when the right mouse button is released, the standard Silverlight options menu appears. What should you do to prevent the standard menu from appearing?

    a. Set the MouseButtonEventArgs.Handled property to true.

    b. Handle the RightMouseButtonUp event.

    c. Set the Grid control's element—IsHitTestVisible property to false.

    d. Set the MouseButtonEventArgs.Handled property to false.

  4. You are developing an out-of-browser Silverlight application. The application will be used both offline and online. You need to display a toast notification to the user when the network connection goes offline. You handle the event of NetworkAddressChanged. Which code snippet should you use inside of the handler to raise the notification when the network is offline?

    a. If(!NetworkInterface.GetIsNetworkAvailable()) { NotificationWindow nw = new NotificationWindow(); nw.Height = 80; nw.Width = 200; TextBlock tb = new TextBlock() { Text = "You are now offline" }; nw.Content = tb; nw.Show(5000) };

    b. If(NetworkInterface.GetIsNetworkAvailable()) { NotificationWindow nw = new NotificationWindow(); nw.Height = 80; nw.Width = 200; TextBlock tb = new TextBlock() { Text = "You are now offline" }; nw.Content = tb; nw.Show(5000) };

    c. If(!NetworkInterface.GetIsNetworkAvailable()) { NotificationWindow nw = new NotificationWindow(); nw.Height = 80; nw.Width = 200; TextBlock tb = new TextBlock() { Text = "You are now offline" }; nw.Show(5000) };

    d. If(NetworkInterface.GetIsNetworkAvailable()) { NotificationWindow nw = new NotificationWindow(); nw.Height = 80; nw.Width = 200; TextBlock tb = new TextBlock() { Text = "You are now offline" }; nw.Content = tb; };

  5. You have a Silverlight 4 application hosted in an ASPX page that has a JavaScript function called ShowMyName. The function expects a single parameter called Name. The Silverlight application has a TextBox element called tbName, into which the user enters a name. You need to pass the content of tbName to the JavaScript function. Which code snippet will you use?

    a. String name = HtmlPage.Window.Invoke("ShowMyName"); name.sendParameter("Johnny");

    b. HtmlPage.Window.Invoke("ShowMyName",Johnny);

    c. HtmlPage.Window.Invoke("ShowMyName","Johnny");

    d. HtmlPage.Document.Invoke("ShowMyName","Johnny");

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.130.13