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); //} } }
public void Execute(object parameter) { ICardSetsCollection collection = parameter as ICardSetsCollection; if (collection != null) { collection.RemoveCard(null); } }
public void Execute(object parameter) { ICardSetsCollection collection = parameter as ICardSetsCollection; if (collection != null) { collection.PrintCards(); } }
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); } } }