private void addButton_Click(object sender, EventArgs e) { if (!Directory.Exists(DataModel.AssistantsFolder)) { Directory.CreateDirectory(DataModel.AssistantsFolder); } UpdateAssistant new_assistant = new UpdateAssistant(); string filename = ""; while (!IsValidFilename(filename) || File.Exists(filename + ".json")) { filename = Essy.Tools.InputBox.InputBox.ShowInputBox("Provide a Filename for this item");; } string name = Essy.Tools.InputBox.InputBox.ShowInputBox("Provide a Name for this Item"); new_assistant.Details.Name = name; string filePath = Path.Combine(DataModel.AssistantsFolder, filename + ".json"); new_assistant.Save(filePath); RefreshTool(); }
private void saveButton_Click(object sender, EventArgs e) { EditedItem.Save(); RefreshTool(); }