public override string getFsOrResourceText(string dir, string name) { string path = correctPath(dir, name); // return(ToolMobile.getFsOrResourceText(dir, name)); }
public ImplReportSource(IEnvironment pEnv, string pLocation) { //if (!Path.IsPathRooted(pLocation)) // pLocation = Path.Combine(ToolMobile.curDir(), pLocation); pLocation = ToolMobile.getFullPath(pLocation); _environment = pEnv; ISettings sInfo = new SettingsFromFileExt(pLocation, _fileInfo, _environment); initRenders(pLocation, sInfo); //var fileContent = ToolMobile.readFileText(Path.Combine(pLocation, sInfo.getString(_varFileDS))); var fileContent = ToolMobile.getFsOrResourceText(pLocation, sInfo.getString(_varFileDS)); _sqlQueryes = getSqlQueryes(fileContent); _aliases = ToolString.explodeList(sInfo.getString(_varListAlias, "TABLE")); string filtersFile = sInfo.getString(_varFileFilter, string.Empty); if (filtersFile != string.Empty) { initFilters(new SettingsFromFileExt(pLocation, filtersFile, _environment)); } else { initFilters(null); } }
static string getSQL(IEnvironment env, string pDsName) { //string file_ = Path.Combine(Path.Combine("config/ref/", pDsName), "ds.sql"); //return ToolMobile.readFileTextByCache(file_); //TODO use cachec ToolMobile.readFileTextByCache var dir = Path.Combine("config/ref/", pDsName); return(ToolMobile.getFsOrResourceText(dir, "ds.sql")); }
protected static string sqlFromFile(string file) { //string obj = ToolMobile.curDir(); //obj = Path.Combine(obj, "config"); //obj = Path.Combine(obj, "sql"); //obj = Path.Combine(obj, file); //return ToolMobile.readFileText(obj); string sql = ToolMobile.getFsOrResourceText("config/sql", file); return(sql); }
static void initLang() { if (cache != null) { return; } try { var cache_tmp = new Dictionary <string, SortedDictionary <string, string> >(); var xmlDoc = new XmlDocument(); var lang_xml = ToolMobile.getFsOrResourceText("config/sys", "lang.xml"); xmlDoc.LoadXml( lang_xml ); var root = xmlDoc["settings"]; foreach (var lang in langs) { var langCache = new SortedDictionary <string, string>(); foreach (var node in root.ChildNodes) { var el = node as XmlElement; if (el != null) { var from = el.Name; var to = ToolXml.getAttribValue(el, lang, el.Name); langCache[from] = to; } } cache_tmp[lang] = langCache; } cache = cache_tmp; } catch (Exception exc) { ToolMobile.setExceptionInner(exc); } }
public ImplXmlReport(string pFile, IEnvironment pEnv) { _environment = pEnv; _script = new SimpleScript(_environment); // var fileContent = ToolMobile.readFileTextByCache(pFile); var fileContent = ToolMobile.getFsOrResourceText(Path.GetDirectoryName(pFile), Path.GetFileName(pFile)); _doc.LoadXml(fileContent); // _rendInfo.count = XmlFormating.helper.parseInt(ToolXml.getAttribValue(_doc.DocumentElement, _constAttrCount, XmlFormating.helper.format(_rendInfo.count))); _rendInfo.isDirect = XmlFormating.helper.parseBool(ToolXml.getAttribValue(_doc.DocumentElement, _constAttrDirect, XmlFormating.helper.format(_rendInfo.isDirect))); _rendInfo.encoding = XmlFormating.helper.parseString(ToolXml.getAttribValue(_doc.DocumentElement, _constAttrEnc, XmlFormating.helper.format(_rendInfo.encoding))); _rendInfo.replace = XmlFormating.helper.parseString(ToolXml.getAttribValue(_doc.DocumentElement, _constAttrReplace, XmlFormating.helper.format(_rendInfo.replace))); // }