Ejemplo n.º 1
0
        public void EhProjectChanged(object sender, Altaxo.Main.ProjectEventArgs e)
        {
            UpdateMenu(null, null);
            ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));

            Altaxo.Main.ProjectService projectService = (Altaxo.Main.ProjectService)ServiceManager.Services.GetService(typeof(Altaxo.Main.ProjectService));
            System.Text.StringBuilder  title          = new System.Text.StringBuilder();
            title.Append(resourceService.GetString("MainWindow.DialogName"));
            if (projectService != null)
            {
                if (projectService.CurrentProjectFileName == null)
                {
                    title.Append(" - ");
                    title.Append(resourceService.GetString("Altaxo.Project.UntitledName"));
                }
                else
                {
                    title.Append(" - ");
                    title.Append(projectService.CurrentProjectFileName);
                }
                if (projectService.CurrentOpenProject != null && projectService.CurrentOpenProject.IsDirty)
                {
                    title.Append("*");
                }
            }
            this.Title = title.ToString();
        }
Ejemplo n.º 2
0
        protected override void OnClosing(CancelEventArgs e)
        {
            base.OnClosing(e);
            Altaxo.Main.ProjectService projectService = (Altaxo.Main.ProjectService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(Altaxo.Main.ProjectService));

            if (projectService != null)
            {
                // projectService.SaveCombinePreferences();

                if (projectService.CurrentOpenProject != null && projectService.CurrentOpenProject.IsDirty)
                {
                    projectService.AskForSavingOfProject(e);
                }
            }
        }