void SavePetriNetCommandExecute() { PetriNetXMLReader reader = new PetriNetXMLReader(); if (CurrentFileName != null) { reader.SaveToXML(CurrentPnmlNet, CurrentFilePath); IsSaved = true; } else { SavePetriNetUnderNewNameCommandExecute(); } }
void SavePetriNetUnderNewNameCommandExecute() { PetriNetXMLReader reader = new PetriNetXMLReader(); SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "XML Files (*.xml)|*.xml"; saveFileDialog.FilterIndex = 0; saveFileDialog.DefaultExt = "xml"; saveFileDialog.FileName = "Petrinet.xml"; if (saveFileDialog.ShowDialog() == true) { reader.SaveToXML(CurrentPnmlNet, saveFileDialog.FileName); CurrentFileName = saveFileDialog.FileName; CurrentFilePath = CurrentFileName; IsSaved = true; } }