public override void Save(string fileName) { base.Save(fileName); if (designer == null) { return; } string oldBuildFile = GuiBuilderService.GetBuildCodeFileName(gproject.Project, window.RootWidget.Name); codeBinder.UpdateBindings(fileName); if (!ErrorMode) { if (designer != null) { designer.Save(); } if (actionsBox != null) { actionsBox.Save(); } } string newBuildFile = GuiBuilderService.GetBuildCodeFileName(gproject.Project, window.RootWidget.Name); if (oldBuildFile != newBuildFile && oldBuildFile != null && newBuildFile != null) { if (System.IO.File.Exists(newBuildFile)) { FileService.DeleteFile(newBuildFile); } if (System.IO.File.Exists(oldBuildFile)) { FileService.MoveFile(oldBuildFile, newBuildFile); } } gproject.Save(true); OnDirtyChanged(EventArgs.Empty); }
protected override async Task OnSave() { await base.OnSave(); if (designer == null) { return; } string oldBuildFile = GuiBuilderService.GetBuildCodeFileName(gproject.Project, window.RootWidget.Name); codeBinder.UpdateBindings(FilePath); if (!ErrorMode) { if (designer != null) { designer.Save(); } if (actionsBox != null) { actionsBox.Save(); } } string newBuildFile = GuiBuilderService.GetBuildCodeFileName(gproject.Project, window.RootWidget.Name); if (oldBuildFile != newBuildFile) { if (System.IO.File.Exists(newBuildFile)) { FileService.DeleteFile(newBuildFile); } FileService.MoveFile(oldBuildFile, newBuildFile); } gproject.SaveWindow(true, window.RootWidget.Name); }
public override void Save(FileSaveInformation fileSaveInformation) { base.Save(fileSaveInformation); if (designer == null) { return; } string oldBuildFile = GuiBuilderService.GetBuildCodeFileName(gproject.Project, window.RootWidget.Name); codeBinder.UpdateBindings(fileSaveInformation.FileName); if (!ErrorMode) { if (designer != null) { designer.Save(); } if (actionsBox != null) { actionsBox.Save(); } } string newBuildFile = GuiBuilderService.GetBuildCodeFileName(gproject.Project, window.RootWidget.Name); if (oldBuildFile != newBuildFile) { if (System.IO.File.Exists(newBuildFile)) { FileService.DeleteFile(newBuildFile); } FileService.MoveFile(oldBuildFile, newBuildFile); } gproject.SaveWindow(true, window.RootWidget.Name); }