Exemple #1
0
        void SavePetriNetCommandExecute()
        {
            PetriNetXMLReader reader = new PetriNetXMLReader();

            if (CurrentFileName != null)
            {
                reader.SaveToXML(CurrentPnmlNet, CurrentFilePath);
                IsSaved = true;
            }
            else
            {
                SavePetriNetUnderNewNameCommandExecute();
            }
        }
Exemple #2
0
        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;
            }
        }