예제 #1
0
 private void Execute_DialogLoad(View.LoadCardPackDialog dialog)
 {
     if (this.CardPackList_SelectedIndex == -1)
     {
         dialog.DialogResult = false;
     }
     else
     {
         dialog.DialogResult = true;
     }
 }
예제 #2
0
        private void Execute_LoadCardPack()
        {
            View.LoadCardPackDialog   newDialog = new View.LoadCardPackDialog();
            LoadCardPackDiagViewModel diagVM    = new LoadCardPackDiagViewModel(newDialog);

            newDialog.DataContext = diagVM;

            if (newDialog.ShowDialog() == true)
            {
                this.lobbyClient.Deck = diagVM.GetSelectedItem();
                this.OnPropertyChanged("ActivePackName");
            }
        }
예제 #3
0
        private void Execute_LoadCardPack()
        {
            View.LoadCardPackDialog   newDialog = new View.LoadCardPackDialog();
            LoadCardPackDiagViewModel diagVM    = new LoadCardPackDiagViewModel(newDialog);

            newDialog.DataContext = diagVM;

            if (newDialog.ShowDialog() == true)
            {
                this.QnAModel.CardPackItem = diagVM.GetSelectedItem();
                this.Card_SelectedIndex    = 0;
                this.OnPropertyChanged("CardTitleList");
            }
        }
예제 #4
0
        private void Execute_LoadCardPack()
        {
            View.LoadCardPackDialog   newDialog = new View.LoadCardPackDialog();
            LoadCardPackDiagViewModel diagVM    = new LoadCardPackDiagViewModel(newDialog);

            newDialog.DataContext = diagVM;

            if (newDialog.ShowDialog() == true)
            {
                {
                    this.QnAModel = new Model.QnAModel(diagVM.GetSelectedItem());
                }
            }
            this.OnPropertyChanged("ActiveCardPack");
        }
예제 #5
0
        private void Execute_ExportCardPack()
        {
            View.LoadCardPackDialog newDialog = new View.LoadCardPackDialog();
            LoadCardPackDiagViewModel diagVM = new LoadCardPackDiagViewModel(newDialog);
            newDialog.DataContext = diagVM;

            CardPack SelectedCardPack;
            if (newDialog.ShowDialog() == true)
            {
                SelectedCardPack = diagVM.GetSelectedItem();

                System.Windows.Forms.SaveFileDialog saveDialog = new System.Windows.Forms.SaveFileDialog();
                saveDialog.Filter = "Card Pack Zip(*.lcpz)|*.lcpz|Any File (*.*)|*.*";
                saveDialog.Title = "export card pack";
                if (saveDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    CardPack.ExportCardPack(SelectedCardPack.PackName, saveDialog.FileName);
                }
            }
        }
예제 #6
0
 private void Execute_DialogCancel(View.LoadCardPackDialog dialog)
 {
     dialog.DialogResult = false;
 }
예제 #7
0
 public LoadCardPackDiagViewModel(View.LoadCardPackDialog newDialog)
 {
     this.Command_DialogLoad         = new DelegateCommand(x => this.Execute_DialogLoad(newDialog));
     this.Command_DialogCancel       = new DelegateCommand(x => this.Execute_DialogCancel(newDialog));
     this.CardPackList_SelectedIndex = -1;
 }