Esempio n. 1
0
 /// <inheritdoc/>
 public override void Invoke()
 {
     using (DesignerOptionsForm options = new DesignerOptionsForm(Designer))
     {
         if (options.ShowDialog() == DialogResult.OK)
         {
             Designer.UpdatePlugins(null);
         }
     }
 }
Esempio n. 2
0
        public bool SaveFile(bool saveAs)
        {
            // update report's script
            Report.ScriptText = Script;

            while (true)
            {
                OpenSaveDialogEventArgs e = new OpenSaveDialogEventArgs(Designer);
                string fileName           = Report.FileName;

                // show save dialog in case of untitled report or "save as"
                if (saveAs || String.IsNullOrEmpty(fileName))
                {
                    if (String.IsNullOrEmpty(fileName))
                    {
                        fileName = Res.Get("Designer,Untitled");
                    }
                    e.FileName = fileName;
                    Config.DesignerSettings.OnCustomSaveDialog(Designer, e);
                    if (e.Cancel)
                    {
                        return(false);
                    }

                    fileName = e.FileName;
                }

                OpenSaveReportEventArgs e1 = new OpenSaveReportEventArgs(Report, fileName, e.Data, e.IsPlugin);

                try
                {
                    Config.DesignerSettings.OnCustomSaveReport(Designer, e1);
                    // don't change the report name if plugin was used
                    if (e.IsPlugin)
                    {
                        fileName = Report.FileName;
                    }
                    Report.FileName = fileName;
                    FModified       = false;
                    Designer.UpdatePlugins(null);
                    if (!e.IsPlugin)
                    {
                        Designer.cmdRecentFiles.Update(fileName);
                    }
                    UpdateCaption();
                    return(true);
                }
                catch
                {
                    // something goes wrong, suggest to save to another place
                    FRMessageBox.Error(Res.Get("Messages,CantSaveReport"));
                    saveAs = true;
                }
            }
        }