Пример #1
0
        public void TestGetTemplateHandleFullPath()
        {
            string templateHandleRootDirPath = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, TemplateHandleRootDirPath));
            string handlePath = MonitorReportFile.GetTemplateHandlePath(templateHandleRootDirPath, "PhShouLianWeeklyReport");

            Assert.IsTrue(File.Exists(handlePath));
        }
Пример #2
0
        public static string CallTemplateHandle(TemplateHandlerPrams para, string handleName)
        {
            const string method     = "WriteFile";
            string       dependPath = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, DependPath));
            string       templateHandleRootDirPath = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, TemplateHandleRootDirPath));
            string       templateHandlePath        = MonitorReportFile.GetTemplateHandlePath(templateHandleRootDirPath, handleName);
            var          cp = new object[] { para };

            CrossDomainCompiler.Call(templateHandlePath, dependPath, typeof(TemplateHandleBase), method, ref cp);
            return(para.FileFullName);
        }