internal async void ExportCardNamesToClipboard(Deck deck)
        {
            if (deck == null || !deck.GetSelectedDeckVersion().Cards.Any())
            {
                MessageDialogs.ShowMessage(this, "", LocUtil.Get("ShowMessage_CopyCardNames_NoCards")).Forget();
                return;
            }

            try
            {
                var selectedLanguage = await MessageDialogs.ShowSelectLanguageDialog(this);

                if (!selectedLanguage.IsCanceled)
                {
                    Enum.TryParse(selectedLanguage.SelectedLanguage, out Locale myLang);
                    var names = deck.GetSelectedDeckVersion().Cards.ToSortedCardList()
                                .Select(c => (Cards.GetFromDbfId(c.DbfIf).GetLocName(myLang)) + (c.Count > 1 ? " x " + c.Count : ""))
                                .Aggregate((c, n) => c + Environment.NewLine + n);

                    Clipboard.SetDataObject(names);
                    Log.Info("Copied " + deck.GetDeckInfo() + " names to clipboard");
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                ErrorManager.AddError("Error copying card names", LocUtil.Get("ShowMessage_CopyCardNames_Error"));
            }
        }
        internal async void ShowNewDeckMessage(string hero)
        {
            var deck = new Deck {
                Class = hero
            };
            var type = await MessageDialogs.ShowDeckTypeDialog(this);

            if (type == null)
            {
                return;
            }
            if (type == DeckType.Arena)
            {
                deck.IsArenaDeck = true;
            }
            else if (type == DeckType.Brawl)
            {
                if (!DeckList.Instance.AllTags.Contains("Brawl"))
                {
                    DeckList.Instance.AllTags.Add("Brawl");
                    DeckList.Save();
                    Core.MainWindow?.ReloadTags();
                }
                deck.Tags.Add("Brawl");
            }
            ShowDeckEditorFlyout(deck, true);
        }
 internal void ExportIdsToClipboard(Deck deck)
 {
     if (deck == null)
     {
         return;
     }
     Clipboard.SetDataObject(Helper.DeckToIdString(deck.GetSelectedDeckVersion()));
     MessageDialogs.ShowMessage(this, "", "copied ids to clipboard").Forget();
     Log.Info("Copied " + deck.GetSelectedDeckVersion().GetDeckInfo() + " to clipboard");
 }
 private async Task <string> InputDeckUrl()
 {
     try
     {
         return(await MessageDialogs.ShowWebImportingDialog(this));
     }
     catch (Exception e)
     {
         Log.Error(e);
         return(null);
     }
 }
        private async void ArenaRewards_OnSave(object sender, RoutedEventArgs e)
        {
            if (!ArenaRewards.Validate(out var warning))
            {
                await MessageDialogs.ShowMessage(this, "Error", warning);

                return;
            }
            _deck.ArenaReward = ArenaRewards.Reward;
            DeckList.Save();
            ArenaStats.Instance.UpdateArenaRewards();
            ArenaStats.Instance.UpdateArenaRuns();
            Close();
        }
        private async Task ShowImportingChoice(Deck deck)
        {
            var choice = Config.Instance.PasteImportingChoice == ImportingChoice.Manual
                                ? await MessageDialogs.ShowImportingChoiceDialog(this) : Config.Instance.PasteImportingChoice;

            if (choice.HasValue)
            {
                if (choice.Value == ImportingChoice.SaveLocal)
                {
                    ShowDeckEditorFlyout(deck, true);
                }
                else
                {
                    ShowExportFlyout(deck);
                }
            }
        }
        internal async void ImportFromClipboard()
        {
            if (_clipboardImportingInProgress)
            {
                return;
            }
            _clipboardImportingInProgress = true;
            var deck = await ClipboardImporter.Import();

            if (deck == null)
            {
                const string dialogTitle = "MainWindow_Import_Dialog_NoDeckFound_Title";
                const string dialogText  = "MainWindow_Import_Dialog_NoDeckFound_Text";
                MessageDialogs.ShowMessage(this, LocUtil.Get(dialogTitle), LocUtil.Get(dialogText)).Forget();
                _clipboardImportingInProgress = false;
                return;
            }
            await ShowImportingChoice(deck);

            _clipboardImportingInProgress = false;
        }