Esempio n. 1
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            /*
             * var result = await StorageManager.CheckObjectData("anime-collection");
             * if (result) {
             *       var currentCollection = await StorageManager.RetrieveObjectData<ObservableCollection<Anime>>("anime-collection");
             *      AnimeManager.SetAnime(currentCollection);
             * }
             */
            try {
                var currentCollection = await StorageManager.ExtractCollection();

                AnimeManager.SetAnime(currentCollection);
            }
            catch (Exception) {
                //throw;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;

                //Initialize StorageManager
                StorageManager.Initialize();
                Debug.WriteLine("Storage Path: " + StorageManager.localFolder.Path);
                AnimeManager.Init();
            }

            if (e.PrelaunchActivated == false)
            {
                if (rootFrame.Content == null)
                {
                    // When the navigation stack isn't restored navigate to the first page,
                    // configuring the new page by passing required information as a navigation
                    // parameter
                    rootFrame.Navigate(typeof(MainPage), e.Arguments);
                }
                // Ensure the current window is active
                Window.Current.Activate();
            }
        }
Esempio n. 3
0
        /// <summary>
        /// This button click will only be used for debugging purposes and will be removed later. Currently used for single import
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            var selectedFolder = await ContentImporter.SelectFolderAsync();

            if (selectedFolder != null)
            {
                var queryName = ContentImporter.FolderNameParse(selectedFolder.DisplayName);
                var id        = await ContentImporter.KitsuAPIQueryAsync(queryName);

                var obj = await KitsuInterface.GetAnime(id);

                var ani = new Anime(selectedFolder);
                ani.ExtractFromObject(obj);
                var task = await ani.PopulateEpisodeList();

                AnimeManager.AddAnime(ani);
                anime.Add(ani);
                //AnimeManager.SetAnime(anime);
                Debug.WriteLine("Number of anime in collection: " + AnimeManager.Count());
                //anime = AnimeManager.GetAnime(); //Refreshes list with new Anime
                //anime = new ObservableCollection<Anime>(AnimeManager.GetAnime());
            }
        }
Esempio n. 4
0
 // Use this for initialization
 void Start()
 {
     single           = this;
     animation        = GetComponent <Animation>();
     animationHandler = PlayRun;
 }