Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }