예제 #1
0
        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");
        }
예제 #2
0
        public static void Boot(SimpleReportConfigData configData)
        {
            if (SLContext.IsServiceInitialized)
            {
                return;
            }

            SharedLibrary.Bootstrapper.Boot(configData, AppName.Reporter);
        }
예제 #3
0
        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;
        }
예제 #4
0
        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,
                });
            }
        }
예제 #5
0
        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;
            }
        }
예제 #6
0
 public ViewerService(SimpleReportConfigData configData)
 {
     Bootstrapper.Boot(configData);
 }