Exemplo n.º 1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            cApp = (CApp)e.Parameter;

            Wide310x150_TextBox.Text   = cApp.GetWide310x150(false).OriginalString;
            Square150x150_TextBox.Text = cApp.GetSquare150x150(false).OriginalString;
            LargeTile_TextBox.Text     = cApp.GetSquare310x310(false).OriginalString;
            Square44x44_TextBox.Text   = cApp.GetSquare44x44(false).OriginalString;
            SmallTile_TextBox.Text     = cApp.GetSquare71x71(false).OriginalString;
        }
Exemplo n.º 2
0
        public static void EditCustomApps(CApp customApp)
        {
            int i = cApps.IndexOf(cApps.FindByName(customApp.name));

            if (cApps[i].appURI == customApp.appURI) // only the appUri can be changed
            {
                return;
            }

            cApps[i] = customApp;
            SaveCustomApps();
        }
Exemplo n.º 3
0
        private async void Save_Button_Click(object sender, RoutedEventArgs e)
        {
            if (!IsFormValid())
            {
                return;
            }

            Saved_Popup.VerticalOffset   = -((FrameworkElement)Saved_Popup.Child).ActualHeight / 2;
            Saved_Popup.HorizontalOffset = -((FrameworkElement)Saved_Popup.Child).ActualWidth / 2;
            Saved_Popup.IsOpen           = true;

            Stopwatch sw = new Stopwatch();

            EnterStoryboard.Begin();
            sw.Start();

            CApp ca = new CApp(cApp.name, CustomUri_TextBox.Text, false);

            StorageFolder localFolder = ApplicationData.Current.LocalFolder;

            foreach (var img in imgs)
            {
                await img.Value.CopyAsync(localFolder, $"{ca.name}_{img.Key}.png", NameCollisionOption.ReplaceExisting);
            }

            CStart.EditCustomApps(ca);
            sw.Stop();

            if (sw.ElapsedMilliseconds < 2500)
            {
                await Task.Delay(2500 - (int)sw.ElapsedMilliseconds);
            }
            await Task.Delay(2500);

            ExitStoryboard.Begin();
            await Task.Delay(1000);

            this.Frame.Navigate(typeof(CustomUriListViewPage));
        }
        private async void Delete(object sender, RoutedEventArgs e)
        {
            string name = ((StackPanel)((Button)sender).Parent).Name;


            if (!CStart.cApps.FindByName(name).firstPartyApp)
            {
                CApp app = arrayOfCApps.FindByName(name);

                await(await StorageFile.GetFileFromApplicationUriAsync(app.GetWide310x150(false))).DeleteAsync();
                await(await StorageFile.GetFileFromApplicationUriAsync(app.GetSquare150x150(false))).DeleteAsync();
                await(await StorageFile.GetFileFromApplicationUriAsync(app.GetSquare310x310(false))).DeleteAsync();
                await(await StorageFile.GetFileFromApplicationUriAsync(app.GetSquare44x44(false))).DeleteAsync();
                await(await StorageFile.GetFileFromApplicationUriAsync(app.GetSquare71x71(false))).DeleteAsync();

                CStart.RemoveCustomApps(app);
            }

            else
            {
                Debug.WriteLine($"!>> Edit: {name} is firstPartyApp");
            }
        }
Exemplo n.º 5
0
 public static void RemoveCustomApps(CApp customApp)
 {
     cApps.Remove(customApp);
     SaveCustomApps();
 }
Exemplo n.º 6
0
 public static void AddCustomApps(CApp customApp)
 {
     cApps.Add(customApp);
     SaveCustomApps();
 }