public CollectionManager(MegaManager newMegaMan)
 {
     RED_PLACEMENT   = new Vector3(1.77f, -2.19f, 0);
     GREEN_PLACEMENT = RED_PLACEMENT + Vector3.right * TOKEN_SEPARATION;
     BLUE_PLACEMENT  = GREEN_PLACEMENT + Vector3.right * TOKEN_SEPARATION;
     ManaPool        = new ManaPool();
 }
        }//sbar_TextChanged

        // "Search button click" event handler
        private void SearchButton_Click(object sender, RoutedEventArgs e)
        {
            var FItems = MegaManager.getMegaItems();

            if (SearchBox.Text != "")
            {
                // All
                FItems = (from s in FItems where s.Headline.Contains(SearchBox.Text) select s).ToList();//LINQ Query
            }
            else
            {
                // do nothing ;)
            }

            MegaItems.Clear();
            FItems.ForEach(p => MegaItems.Add(p));
        }//
        }//

        // ** FIRST PROCESS **
        private async void Page_Loaded(object sender, RoutedEventArgs e)
        {
            MyProgressRing.IsActive   = true;
            MyProgressRing.Visibility = Visibility.Visible;


            // ******************************************************************

            // phase 1
            // !!
            //MegaItems = new ObservableCollection<Model.DataItem>();

            //TEST 0
            //megaStorageURL = "https://mega.nz/#F!e1ogxQ7T!ee4Q_ocD1bSLmNeg9B6kBw"; // Sample 1 (created by someone)

            //TEST 1
            //megaStorageURL = "https://mega.nz/folder/YdlWiaxD#7qcjO0mtYukRBCuDzoIwGA"; // Sample 2 (created by ME)

            //TEST 2
            megaStorageURL = "https://mega.nz/#F!SYtigRjB!EhNuflDF9fefSXuolgn0Rw"; // Prod (W10M)

            // phase 2
            // Collect and prepare Mega.nz data...
            await PreprocessAsync(megaStorageURL); // non-async


            // Start loading Data from Mega.Nz...

            /*
             * while (Contact.MegaCount < 1923)
             * {
             *  Task t = PreprocessAsync(megaStorageURL);//MarvelFacade.PopulateMarvelCharactersAsync(MarvelCharacters);
             *  await t;
             * }
             */

            // ************************************************

            /*
             * var FItems = MegaManager.getMegaItems();
             *
             *
             * if (MegaItems != null)
             * {
             *  MegaItems.Clear();
             *  FItems.ForEach(p => MegaItems.Add(p));
             * }
             */


            // ******************************************************************


            MegaManager.GetAllNews(MegaItems);

            // HOME is pre-select category (when 1st page load) =)
            Home.IsSelected = true;

            MyProgressRing.IsActive   = false;
            MyProgressRing.Visibility = Visibility.Collapsed;
        }
 // Hamburger Menu "List" (ListBox) Item Selection handler
 private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (Home.IsSelected)
     {
         MegaManager.GetAllNews(MegaItems);
         TitleTextBlock.Text = $"Home";
     }
     else if (Guides.IsSelected)
     {
         MegaManager.GetItemsbyCategory("!Guides", MegaItems);
         TitleTextBlock.Text = $"Guides";
     }
     else if (CameranPhotos.IsSelected)
     {
         MegaManager.GetItemsbyCategory("Camera + Photos", MegaItems);
         TitleTextBlock.Text = $"Camera + Photos";
     }
     else if (Customization.IsSelected)
     {
         MegaManager.GetItemsbyCategory("Customization", MegaItems);
         TitleTextBlock.Text = $"Customization";
     }
     //else if (Dependencies.IsSelected)
     //{
     //    MegaManager.GetItemsbyCategory("Dependencies", MegaItems);
     //    TitleTextBlock.Text = $"Dependancies";
     //}
     //else if (Emulators.IsSelected)
     //{
     //    MegaManager.GetItemsbyCategory("Emulators", MegaItems);
     //    TitleTextBlock.Text = $"Emulators";
     //}
     //else if (HPExclusive.IsSelected)
     //{
     //    MegaManager.GetItemsbyCategory("Hp exclusive apps", MegaItems);
     //    TitleTextBlock.Text = $"HP exclusive apps";
     //}
     else if (MicrosoftApps.IsSelected)
     {
         MegaManager.GetItemsbyCategory("Microsoft apps (Stock,leaked,retired,Extensions, etc)", MegaItems);
         TitleTextBlock.Text = $"Microsoft apps";
     }
     else if (Multimedia.IsSelected)
     {
         MegaManager.GetItemsbyCategory("Multimedia", MegaItems);
         TitleTextBlock.Text = $"Multimedia";
     }
     else if (OldMemories.IsSelected)
     {
         MegaManager.GetItemsbyCategory("Old memories and resources", MegaItems);
         TitleTextBlock.Text = $"Old memories and resources";
     }
     //else if (Productivity.IsSelected)
     //{
     //    MegaManager.GetItemsbyCategory("Productivity", MegaItems);
     //    TitleTextBlock.Text = $"Productivity";
     //}
     else if (Social.IsSelected)
     {
         MegaManager.GetItemsbyCategory("Social", MegaItems);
         TitleTextBlock.Text = $"Social";
     }
     else if (Tweaks.IsSelected)
     {
         MegaManager.GetItemsbyCategory("Tools and Tweaks", MegaItems);
         TitleTextBlock.Text = $"Tools and Tweaks";
     }
     else if (Travel.IsSelected)
     {
         MegaManager.GetItemsbyCategory("Travel, Weather, News, Sports, Navigation", MegaItems);
         TitleTextBlock.Text = "Travel, Weather, etc.";
     }
     //else if (W10M.IsSelected)
     //{
     //    MegaManager.GetItemsbyCategory("W10M PC Tools", MegaItems);
     //    TitleTextBlock.Text = "W10M PC Tools";
     //}
     else if (XBox.IsSelected)
     {
         MegaManager.GetItemsbyCategory("Xbox and Non Xbox live Games", MegaItems);
         TitleTextBlock.Text = "Xbox and Non Xbox live Games";
     }
     SearchBox.Text = ""; // clear SearchBox =)
 }//
Exemple #5
0
 void Awake()
 {
     MegaMan = FindObjectOfType <MegaManager>();
 }