AmazedSaint.Elastic.Templating.DynamicTemplateHost.LoadIncludeText C# (CSharp) Метод

LoadIncludeText() публичный Метод

The engine calls this method based on the optional include directive if the user has specified it in the text template.
public LoadIncludeText ( string requestFileName, string &content, string &location ) : bool
requestFileName string
content string
location string
Результат bool
        public virtual bool LoadIncludeText(string requestFileName, out string content, out string location)
        {
            content = System.String.Empty;
            location = System.String.Empty;

            //If the argument is the fully qualified path of an existing file,
            //then we are done.
            if (File.Exists(requestFileName))
            {
                content = File.ReadAllText(requestFileName);
                return true;
            }

            string candidate = Path.Combine(Path.GetDirectoryName(this.TemplateFile), requestFileName);
            if (File.Exists(candidate))
            {
                content = File.ReadAllText(candidate);
                return true;
            }

            //This can be customized to search specific paths for the file.
            else
            {
                return false;
            }
        }