Esempio n. 1
0
 public bool IsPair(Card card)
 {
     return (ParentCardPair.Card1 == card || ParentCardPair.Card2 == card) ;
 }
Esempio n. 2
0
        private void CopyResources(Card card)
        {
            foreach (Decal dec in card.Decals)
            {
                if (dec is VideoDecal || dec is ImageDecal)
                {
                    try
                    {
                        string fileName = Path.GetFileName(dec.MetaData.Source);

                        string newFile = Path.Combine(RootPath, fileName);

                        if (dec.MetaData.Source == newFile)
                            continue;

                        if (File.Exists(newFile))
                        {
                            File.Delete(newFile);
                        }

                        File.Copy(dec.MetaData.Source, newFile);

                        dec.MetaData.Source = newFile;
                        dec.MetaData.DisplaySource = fileName;

                    }
                    catch (Exception e)
                    {
                        Utils.LogException(MethodBase.GetCurrentMethod(), e);

                        //There are some problem Saving the Deck..
                        IsBusy = false;
                    }
                }
            }
        }
Esempio n. 3
0
        protected override void OnInitialize()
        {
            _activeCard = _card1;
            _card1.Initialize();
            _card2.Initialize();

            #if !SILVERLIGHT
            SetCover = new DelegateCommand(() =>
            {
             //   ParentDeck.SetCover(this);
            });

            DeletePair = new DelegateCommand(() =>
            {
                TaskDialog dlg = new TaskDialog()
                {
                    Caption = (string)Application.Current.FindResource("Resource_MessageBox_DeletePairCaption"),
                    Text = (string)Application.Current.FindResource("Resource_MessageBox_DeletePairText"),
                    Icon = TaskDialogStandardIcon.Warning,
                    Cancelable = true,
                    StandardButtons = TaskDialogStandardButtons.Yes | TaskDialogStandardButtons.No
                };

                if (dlg.Show() == TaskDialogResult.Yes)
                {
                    if (ParentDeck.SelectedCardPair == this)
                        ParentDeck.SelectedCardPair = null;
                    this.IsDeleted = true;
                    ParentDeck.IsDirty = true;
                }
            });
            #endif
        }