Friday, June 19, 2009

Application security

•Application security refers to the integration of the Silverlight plug-in in the browser
•And whether you allow calls between the HTML DOM and the Silverlight plug-in.

Security in silverlight

•There are three main security areas covered in the Silverlight documentation.
•Application security
•HTTP security
•Sockets security

How toPerform Isolated Storage Tasks

•Obtaining an isolated store for an application.
•Creating a file system of directories and files.
•Writing to a file and then reading it.
•Deleting a file.
•Finding directories.
•Requesting an increased quota size.
•Removing the store.

Isolated Storage Overview

•With isolated storage, data is always isolated by the user in a virtual file system that can be just one file in the root directory or a tree of directories and files.

•The isolated storage data compartment is an abstraction, not a specific storage location.
It consists
•one or more isolated storage files,
•called stores, which contain the actual directory locations where data is stored.

•Stores usually reside on the client but an application can also use isolated storage on a server.
•Silverlight does not support roaming profiles that enable information to travel with a user.

Error Handling Using the Default OnError Event Handler

•The Silverlight.js file provides a default event handler for the OnError handler parameter
•When you leave the onError parameter in a CreateObject call unspecified or null, the default handler function defined in Silverlight.js is invoked
The OnError handler is used for
•XAML parsing errors
• errors that occur during load
•run-time errors
•errors in synchronous method calls that are not handled in a try/catch block
•asynchronous error events that do not have an attached event listener.

Error Handling

•The Silverlight 2 managed API introduces a managed layer of error handling and exception handling.
• In order to handle exceptions that originate from your application's user code, you can register a handler for UnhandledException
• Platform code exceptions, as well as exceptions that you choose not to handle with UnhandledException, are passed to the native/unmanaged error mechanism in the Silverlight plug-in.
•At this level, you can choose to process the errors using the OnError handler that is specified during plug-in instantiation
•Some errors and exceptions prevent further coding or scripting to Silverlight
•Others are considered less serious and allow you to continue coding or scripting

data binding diagram and its explanation




•The source object that contains the data that flows between the source and target. The source can be any CLR object.
•The target UI property that displays and possibly allows user changes to the data. The target can be any DependencyProperty of a FrameworkElement.
•The direction of the data flow. The direction is specified by setting the Mode property on the Binding object.
•The optional value converter that applies to the data as it is passed. The value converter is a class that implements IValueConverter.