コード例 #1
0
        private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
        {
            WebServiceManager.GetAllCards(0); // use 1 to get only collectible cards
            List <MainConsole.Classes.Card> listCards = WebServiceManager.ProvideCardList();

            dataGrid.ItemsSource = null;
            dataGrid.ItemsSource = listCards;
        }
コード例 #2
0
        public MainWindow()
        {
            InitializeComponent();

            chkIsCollectible.Checked   += CheckBox_Checked;
            chkIsCollectible.Unchecked += CheckBox_Unchecked;

            WebServiceManager.RegularImagesFilePath = @"file:///C:\HS_RegularCardsTemp\";
            WebServiceManager.GoldImagesFilePath    = @"file:///C:\HS_GoldCardsTemp\";

            WebServiceManager.GetAllCards(Convert.ToInt32(chkIsCollectible.IsChecked.Value)); // use 1 to get only collectible cards
            List <MainConsole.Classes.Card> listCards = WebServiceManager.ProvideCardList();

            dataGrid.ItemsSource = listCards;

            //myGrid.ItemsSource = null;
            //myGrid.ItemsSource = myDataSource;
        }
        private static void DownloadJsonCardDataUI()
        {
            Console.WriteLine("\r\n");
            Console.WriteLine("Download Json card data?");
            Console.WriteLine("Y for Yes, N for No");

            if (Console.ReadKey().KeyChar.ToString().ToUpper() == ConsoleKey.Y.ToString().ToUpper())
            {
                DisplayConsoleUI_IsCollectible();

                Console.WriteLine("\r\n");
                Console.WriteLine("DOWNLOADING card data from json api...");
                WebServiceManager.GetAllCards(isCollectible);
                Console.WriteLine("\r\n");

                if (isCollectible == 0)
                {
                    Console.WriteLine("DONE downloading card data from json api. Json card data for ALL CARDS is now in memory.");
                    Console.WriteLine("----------------------");
                }
                else
                {
                    Console.WriteLine("DONE downloading card data from json api. Json card data for COLLECTIBLE CARDS ONLY, is now in memory.");
                    Console.WriteLine("----------------------");
                }
            }
            else
            {
                Console.WriteLine("\r\n");
                Console.WriteLine("----------------------");
                Console.WriteLine("C to continue E to exit");

                if (Console.ReadKey().KeyChar.ToString().ToUpper() == ConsoleKey.C.ToString())
                {
                    DisplayConsoleUI();
                }
                else if (Console.ReadKey().KeyChar.ToString().ToUpper() == ConsoleKey.E.ToString())
                {
                    Environment.Exit(0);
                }
            }
        }