public MainWindow() { InitializeComponent(); DataContext = this; Loaded += OnLoaded; Unloaded += OnUnloaded; var configData = new SimpleReportConfigData { ProjectPath = Path.Combine(Environment.CurrentDirectory, "Projects"), TempPath = Path.Combine(Environment.CurrentDirectory, "Temp") }; if (!Directory.Exists(configData.ProjectPath)) { Directory.CreateDirectory(configData.ProjectPath); } if (!Directory.Exists(configData.TempPath)) { Directory.CreateDirectory(configData.TempPath); } m_Reporter = new ReportService(configData); m_Reporter.InitLogger("ReporterLog"); m_ReportViewer = new ViewerService(configData); m_ReportViewer.InitLogger("ReporterLog"); }
public static void Boot(SimpleReportConfigData configData) { if (SLContext.IsServiceInitialized) { return; } SharedLibrary.Bootstrapper.Boot(configData, AppName.Reporter); }
public static void Boot(SimpleReportConfigData configData) { if (SLContext.IsViewerInitialized) { return; } SharedLibrary.Bootstrapper.Boot(configData, AppName.Viewer); SrvContext.ViewerData = new SimpleViewerData(); SrvContext.CleanupFiles = new List <string>(); SLContext.IsViewerInitialized = true; }
public ReportService(SimpleReportConfigData configData) { try { Bootstrapper.Boot(configData); Templater = new TemplateService(SLContext.Config.ProjectPath); } catch (Exception ex) { SLLog.WriteError(new LogData { Source = ToString(), FunctionName = "Init ReportService Error!", Ex = ex, }); } }
public static void Boot(SimpleReportConfigData configData, AppName appName) { if (SLContext.CurrentCtx != null) { return; } SLContext.CurrentCtx = new CurrentContext(); SLContext.Config = configData; if (SLContext.Config == null || string.IsNullOrEmpty(SLContext.Config.ProjectPath)) { SLContext.Config = new SimpleReportConfigData { ProjectPath = Path.Combine(SLContext.CurrentCtx.WorkingDirectory, "Projects") } } ; if (string.IsNullOrEmpty(SLContext.Config.TempPath)) { SLContext.Config.TempPath = Path.Combine(SLContext.CurrentCtx.WorkingDirectory, "Temp"); } CheckFolders(); switch (appName) { case AppName.Reporter: break; case AppName.Viewer: break; case AppName.Templater: break; } }
public ViewerService(SimpleReportConfigData configData) { Bootstrapper.Boot(configData); }