Ejemplo 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             = AppFs(appName);
                    DirectoryInfo appTemplateDir    = new DirectoryInfo(appFs.GetAbsolutePath(dustRelativePath));

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

            return(result);
        }
Ejemplo n.º 2
0
        private void ForEachProxiedClass(Action <Type> doForEachProxiedType)
        {
            string        serviceProxyRelativePath = ServiceProxyRelativePath;
            DirectoryInfo serviceDir = new DirectoryInfo(ServerRoot.GetAbsolutePath(serviceProxyRelativePath));

            if (serviceDir.Exists)
            {
                ForEachProxiedClass(serviceDir, doForEachProxiedType);
            }
            else
            {
                Logger.AddEntry("{0}:{1} directory was not found", LogEventType.Warning, this.Name, serviceDir.FullName);
            }
        }