using FastReport; using FastReport.Utils; using System.Windows; namespace Designer { public partial class App : Application { private void Application_Startup(object sender, StartupEventArgs e) { this.ShutdownMode = ShutdownMode.OnExplicitShutdown; Config.DesignerSettings.ShowInTaskbar = true; Config.DesignerSettings.EmbeddedPreview = true; Config.ReportSettings.ShowPerformance = true; #if NETCOREAPP // RoslynPad as a code editor (available in net6.0-windows target) FastReport.WPF.RoslynPad.SyntaxEditor.Register(); #endif using (var report = new Report()) { string fileName = ""; bool preview = false; foreach (var arg in e.Args) { if (arg.IndexOf("/preview") != -1) { preview = true; } else if (arg.IndexOf("/savepath=") != -1) { int i = arg.IndexOf('='); string path = arg.Substring(i + 1).Trim('"'); Config.SaveFolder = path; } else { fileName = arg; } } if (!string.IsNullOrEmpty(fileName)) report.Load(fileName); if (preview) { //report.Prepare(); //report.ShowPrepared(); report.ShowAsync(); } else { report.Design(); } } this.Shutdown(); } } }