//Save to existing file private void SaveToExistingFile() { if (StaticValues.staticFilename != null) { SaveToXML save = new SaveToXML(products, clients, this); save.Save(); StaticValues.isSaved = true; } else { SaveByDialog(); } }
//------------------------------------------------------ //-----------------------SAVE & OPEN-------------------- //Save by FileDialog private void SaveByDialog() { SaveFileDialog saveAsDialog = new SaveFileDialog(); saveAsDialog.Filter = "dls файл | *.dls"; if (saveAsDialog.ShowDialog() == true) { SaveToXML save = new SaveToXML(products, clients, this); StaticValues.staticFilename = saveAsDialog.FileName; save.Save(); StaticValues.isSaved = true; } }