예제 #1
0
 public override void WillEnterForeground(UIApplication application)
 {
     if (LoginViewModel.ShouldShowLogin(Settings.LastUseTime))
     {
         var login = new LoginViewController(service);
         favoritesViewController.PresentViewController(login, false, null);
     }
 }
예제 #2
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Theme.Apply();

            //
            // Create the service
            //

            // Local CSV file
            service = MemoryDirectoryService.FromCsv("Data/XamarinDirectory.csv");

            // LDAP service - uncomment to try it out.
            //service = new LdapDirectoryService {
            //	Host = "ldap.mit.edu",
            //	SearchBase = "dc=mit,dc=edu",
            //};

            //
            // Load the favorites
            //
            var favoritesRepository = XmlFavoritesRepository.OpenIsolatedStorage("Favorites.xml");

            if (favoritesRepository.GetAll().Count() == 0)
            {
                favoritesRepository = XmlFavoritesRepository.OpenFile("Data/XamarinFavorites.xml");
                favoritesRepository.IsolatedStorageName = "Favorites.xml";
            }

            //
            // Load the last search
            //
            Search search = null;

            try {
                search = Search.Open("Search.xml");
            }
            catch (Exception) {
                search = new Search("Search.xml");
            }

            //
            // Build the UI
            //
            favoritesViewController = new FavoritesViewController(favoritesRepository, service, search);

            window = new UIWindow(UIScreen.MainScreen.Bounds);
            window.RootViewController = new UINavigationController(favoritesViewController);
            window.MakeKeyAndVisible();

            //
            // Show the login screen at startup
            //
            var login = new LoginViewController(service);

            favoritesViewController.PresentViewController(login, false, null);

            return(true);
        }
예제 #3
0
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			Theme.Apply ();

			//
			// Create the service
			//

			// Local CSV file
			service = MemoryDirectoryService.FromCsv ("Data/XamarinDirectory.csv");

			// LDAP service - uncomment to try it out.
			//service = new LdapDirectoryService {
			//	Host = "ldap.mit.edu",
			//	SearchBase = "dc=mit,dc=edu",
			//};

			//
			// Load the favorites
			//
			var favoritesRepository = XmlFavoritesRepository.OpenIsolatedStorage ("Favorites.xml");

			if (favoritesRepository.GetAll ().Count () == 0) {
				favoritesRepository = XmlFavoritesRepository.OpenFile ("Data/XamarinFavorites.xml");
				favoritesRepository.IsolatedStorageName = "Favorites.xml";
			}

			//
			// Load the last search
			//
			Search search = null;
			try {
				search = Search.Open ("Search.xml");
			}
			catch (Exception) {
				search = new Search ("Search.xml");
			}

			//
			// Build the UI
			//
			favoritesViewController = new FavoritesViewController (favoritesRepository, service, search);

			window = new UIWindow (UIScreen.MainScreen.Bounds);
			window.RootViewController = new UINavigationController (favoritesViewController);
			window.MakeKeyAndVisible ();

			//
			// Show the login screen at startup
			//
			var login = new LoginViewController (service);
			favoritesViewController.PresentViewController (login, false, null);

			return true;
		}
예제 #4
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            if (!UIDevice.CurrentDevice.CheckSystemVersion (7, 0))
                Theme.Apply ();

            //
            // Create the service
            //

            // Local CSV file
            service = MemoryDirectoryService.FromCsv ("Data/XamarinDirectory.csv");

            //
            // Load the favorites
            //
            var favoritesRepository = XmlFavoritesRepository.OpenIsolatedStorage ("Favorites.xml");

            if (favoritesRepository.GetAll ().Count () == 0) {
                favoritesRepository = XmlFavoritesRepository.OpenFile ("Data/XamarinFavorites.xml");
                favoritesRepository.IsolatedStorageName = "Favorites.xml";
            }

            //
            // Load the last search
            //
            Search search = null;
            try {
                search = Search.Open ("Search.xml");
            } catch (Exception) {
                search = new Search ("Search.xml");
            }

            //
            // Build the UI
            //
            favoritesViewController = new FavoritesViewController (favoritesRepository, service, search);

            window = new UIWindow (UIScreen.MainScreen.Bounds) {
                RootViewController = new UINavigationController (favoritesViewController)
            };
            window.MakeKeyAndVisible ();

            //
            // Show the login screen at startup
            //
            var login = new LoginViewController (service);
            favoritesViewController.PresentViewController (login, false, null);

            return true;
        }
예제 #5
0
 public override void WillEnterForeground(UIApplication application)
 {
     if (LoginViewModel.ShouldShowLogin (Settings.LastUseTime)) {
         var login = new LoginViewController (service);
         favoritesViewController.PresentViewController (login, false, null);
     }
 }