コード例 #1
0
        public void Execute(object parameter)
        {
            ICardSetsCollection collection = parameter as ICardSetsCollection;

            if (collection != null)
            {
                Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
                dlg.FileName   = "Document";                                        // Default file name
                dlg.DefaultExt = ".cardset.xml";                                    // Default file extension
                dlg.Filter     = "Card Set documents (.cardset.xml)|*.cardset.xml"; // Filter files by extension

                // Show save file dialog box
                Nullable <bool> result = dlg.ShowDialog();

                // Process save file dialog box results
                if (result == true)
                {
                    collection.ExportSet(dlg.FileName);
                }
                //else
                //{
                //    MessageBox.Show("There was an error saving the card set. " + dlg.FileName);
                //}
            }
        }
コード例 #2
0
        public void Execute(object parameter)
        {
            ICardSetsCollection collection = parameter as ICardSetsCollection;

            if (collection != null)
            {
                collection.RemoveCard(null);
            }
        }
コード例 #3
0
ファイル: PrintCommand.cs プロジェクト: jamClark/Card-Maker
        public void Execute(object parameter)
        {
            ICardSetsCollection collection = parameter as ICardSetsCollection;

            if (collection != null)
            {
                collection.PrintCards();
            }
        }
コード例 #4
0
        public void Execute(object parameter)
        {
            ICardSetsCollection collection = parameter as ICardSetsCollection;

            if (collection != null)
            {
                Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
                dlg.FileName   = "Document";                                   // Default file name
                dlg.DefaultExt = ".cardgame";                                  // Default file extension
                dlg.Filter     = "Card File documents (.cardgame)|*.cardgame"; // Filter files by extension

                // Show save file dialog box
                Nullable <bool> result = dlg.ShowDialog();

                // Process save file dialog box results
                if (result == true)
                {
                    collection.OpenWorkspace(dlg.FileName);
                }
            }
        }