Esempio n. 1
0
        public string Templates(string appName, bool min = false)
        {
            string result = string.Empty;

            if (_compiledTemplates == null)
            {
                _compiledTemplates = new Dictionary <string, string>();
            }

            lock (_compiledTemplatesLock)
            {
                if (_compiledTemplates.ContainsKey(appName))
                {
                    result = _compiledTemplates[appName];
                }
                else
                {
                    // templates are in ~s:/dao/dust and ~a:/dao/dust
                    string        dustRelativePath  = ViewsRelativePath;
                    DirectoryInfo commonTemplateDir = new DirectoryInfo(ServerRoot.GetAbsolutePath(dustRelativePath));
                    Fs            appFs             = BamConf.AppFs(appName); //AppFs(appName);
                    DirectoryInfo appTemplateDir    = new DirectoryInfo(appFs.GetAbsolutePath(dustRelativePath));

                    StringBuilder tmp = new StringBuilder();
                    tmp.AppendLine(DustScript.CompileTemplates(commonTemplateDir));
                    tmp.AppendLine(DustScript.CompileTemplates(appTemplateDir));
                    _compiledTemplates[appName] = tmp.ToString();
                    result = _compiledTemplates[appName];
                }
            }

            return(result);
        }
Esempio n. 2
0
 public Fs AppFs(string appName)
 {
     return(BamConf.AppFs(appName));
 }