Beispiel #1
0
        private void item_Click(object sender, EventArgs e)
        {
            if(CardBase.IsInitialized) {
                // check if there is already a deck
                // and save it
                if(this.deckLayout.Items.Count > 0
                && this.deckLayout.Groups.Count == 4) {
                    if(MessageBox.Show(
                        "There is a deck already loaded. You want to save it first?",
                        "Lhurgoyf Deck Editor",
                        MessageBoxButtons.YesNo,
                        MessageBoxIcon.Exclamation
                    ) == System.Windows.Forms.DialogResult.Yes) {
                        this.SaveFile(true);
                    }
                }

                // load deck
                string filename = ((ToolStripMenuItem)sender).Tag.ToString();
                string ext = Path.GetExtension(filename);

                LoadingForm loadingForm = new LoadingForm(filename);
                if(loadingForm.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) {
                    //FileHandler fileLoader = FileHandler.GetFileHandlerByExtension(ext);

                    //Deck deck = fileLoader.Load(filename);
                    //List<string> archeTypes = ArchetypeIdentify.Identify(deck);

                    //this.LoadDeckToDeckViewer(deck, archeTypes);

                    //this.LoadRecentFiles(filename);
                }
            }
            else {
                MessageBox.Show(
                    "Please load a card database first.",
                    "Lhurgoyf Deck Editor",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation
                );
            }
        }
Beispiel #2
0
        private void Initialize()
        {
            LoadingForm loadingForm = new LoadingForm(null);

            if(loadingForm.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) {
                //this.LoadDataToTreeView("");

                this._imageLoader = new ImageLoader();

                this.tspbImageLoader.Maximum = this._imageLoader.ItemsToLoad;
                this.tslblImageLoader.Text = "ImageLoader initialized.";

                this._imageLoader.ImageLoaderResponse += new ImageLoader.ImageLoaderEventHandler(imageLoader_ImageLoaderResponse);
                this._imageLoader.ImageLoaderFinish += new ImageLoader.ImageLoaderFinishEventhandler(imageLoader_ImageLoaderFinish);
            }

            loadingForm.Close();
        }