Exemplo n.º 1
0
        public static void LoadFromIsolatedStorage()
        {
            String result = "";

            result = App.LoadStringFromIsolatedStorage("CurrentRoute.xml");
            if (!String.IsNullOrWhiteSpace(result))
            {
                GRoute currRoute;
                GPointConverter.FromIsolatedStorageFormatToGRoute(result, out currRoute);

                if (currRoute.Coordinates.Count > 0)
                {
                    gRouteTrackViewModel.CurrentRoute = currRoute;
                    MessageBox.Show("Loaded CurrentRoute from isolatedStorage"); //TO-DO Log File
                }
            }
            App.DeleteFileFromIsolatedStorage("CurrentRoute.xml");

            result = App.LoadStringFromIsolatedStorage("Routes.xml");
            if (!String.IsNullOrWhiteSpace(result))
            {
                List <GRoute> routes = new List <GRoute>();
                GPointConverter.FromIsolatedStorageFormatToGRoutes(result, out routes);

                if (routes.Count > 0)
                {
                    gRouteTrackViewModel.RoutesOnPhone = new ObservableCollection <GRoute>(routes);
                    MessageBox.Show("Loaded Routes from isolatedStorage"); //TO-DO Log File
                }
            }
            App.DeleteFileFromIsolatedStorage("Routes.xml");
        }