Calendar Silverlight - 3 in 1 Enterprise Silverlight Scheduling component software        
    How To ...    
         
Implement Calendar Silverlight with XML Data
and Local / Isolated  Storage
 
           
     

Calendar Silverlight includes a custom dll (dbiCalendarSLDB.dll) to help developers quickly manage XML data and storing that data locally or in Isolated Storage.

The dbiCalendarSLDB assembly has been designed to allow developers to quickly implement an XML database that persists the state of the dbiCalendarSL collections in either the Isolated Storage assigned to the application or to a local directory accessible from the client machine.

An IMPORTANT NOTE: with Silverlight, there is no direct access to the operating system's file system, except through the Open File dialog box. When using the Save and Load from Local Directory functionality, the user is prompted to enter/select the location and name of the file for the XML Data. This is a limitation of the Silverlight architecture which prevents the application from obtaining a handle to the local directory without the knowledge of the user. However, you can use isolated storage to store data locally on the user's computer. By default a Silverlight application is given 1MB of storage in its Isolated Storage. If the XML Data is to be stored in the isolated storage the developer may be required to expand the size of the isolated storage allocated to the application.

The dbiCalendarSLDB assembly included with Calendar Silverlight requires the developer to add it as a reference to the project in order to use it. Once the assembly is referenced the following steps can be taken to implement in your application …

   
         
         
         
         
         
         
         
         
         
       
         
         
         
         
         
     
  1. Create a variable of type dbiCalendarSLDB.dbiCalendarSLDB in the applications class declaration.

    [VB.NET]

    Private myCalendarSLDB As dbiCalendarSLDB.dbiCalendarSLDB

    [C#]

    private dbiCalendarSLDB.dbiCalendarSLDB myCalendarSLDB;
  2.  Create an instance of the dbiCalendarSLDB (XML Database Engine) passing in the instance of the dbiCalendarSL control on the form. This binds the XML Database functionality to the instance of the calendar control. Typically this would be done in the New() event of the main form of the application.

    [VB.NET]

    myCalendarSLDB = New dbiCalendarSLDB.dbiCalendarSLDB(Me.DbiCalendarSL1)

    [C#]

    myCalendarSLDB = new dbiCalendarSLDB.dbiCalendarSLDB(DbiCalendarSL1);
  3.  Implement the Save and Load functionality based on the requirement of the application. This may be through a menu selection, button click, or passively when the application starts up/shuts down.
   
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
     

The dbiCalendarSLDB class contains four methods to save and load the collections from the dbiCalendarSL control …

SaveAll2IsolatedStorage() – saves the contents of the dbiCalendarSL control to the isolated storage assigned to the application. By default, the XML data is saved to a sub-directory named “CalendarDatabase” in the isolated storage. This can be overridden by setting the dbiCalendarSLDB.IsolatedStorageDatabaseDirectory property on the class. The method returns a System.Exception if an error is encountered or nothing if it completes successfully.

SaveAll2LocalDirectory(myFileName2Save) – saves the contents of the dbiCalendarSL control to a file name and directory as selected by the user. By default the file name for the XML data is set to "dbiCalendarSLDB"

The developer can override the default name for the file in the SaveAll2LocalDirectory method by passing a string describing the name for the file. The method returns a System.Exception if an error is encountered or nothing if it completes successfully. IMPORTANT NOTE: Silverlight security prevents the application from obtaining the path/name of the file being saved and therefore there is no way to persist the location of the last save location and filename. When the SaveAll2LocalDirectory method is invoked the user will be prompted to authorize the action and select a location/file name in which to save the XML data.

LoadAllFromIsolatedStorage() – loads the contents of the dbiCalendarSL control from an XML database in the Isolated Storage allocated to the application. The method returns a System.Exception if an error is encountered or nothing if it completes successfully.

LoadAllFromLocalDirectory() – loads the contents of the dbiCalendarSL control from an XML database stored in a file name and directory as selected by the user. The method returns a System.Exception if an error is encountered or nothing if it completes successfully. IMPORTANT NOTE: Silverlight security prevents the application from obtaining the path/name of the file being opened and therefore there is no way to persist the location of the last load location and filename. When the LoadAllFromLocalDirectory method is invoked the user will be prompted to select the location and name of the file in which the XML data resides.

IMPORTANT NOTE: The dbiCalendarSLDB Save and Load functionality will only persist object tag data that is of type String. Any tag objects that are not of type string will be ignored.

   
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
      Have a Great Scheduling Day !    
           
         
  Calendar Silverlight  
         
   
  Take Advantage 
         
         
           
DBI Support Products Downloads  Purchase
Customers Support Request Form Calendar Silverlight  Trial Downloads Order Page
News Releases FAQ Calendar WPF  Academic Licensing
Contact Us License Registration Studio Controls for COM Legacy Activations
Updates Studio Controls for .NET 
Utilities Solutions Schedule for COM
Support Policies Solutions Schedule for .NET 
Product Life Support Solutions Schedule Silverlight 
Platform Products Staff Scheduler 
Contact Us Extractor - keyword | key phrase Summary
  Warehouse Scheduling Framework
   
  all rights reserved  |  copyright  1996 - 2016  |  Terms of Use