T4Scaffolding.Core.Templating.DynamicTextTemplatingEngineHost.ResolvePath C# (CSharp) Метод

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

A directive processor can call this method if a file name does not have a path. The host can attempt to provide path information by searching specific paths for the file and returning the file and path if found. This method can be called 0, 1, or more times.
public ResolvePath ( string fileName ) : string
fileName string
Результат string
        public string ResolvePath(string fileName) {
            if (fileName == null) throw new ArgumentNullException("fileName");

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

            // Maybe the file is in the same folder as the text template that 
            // called the directive.
            string candidate = Path.Combine(Path.GetDirectoryName(TemplateFile), fileName);
            if (File.Exists(candidate)) {
                return candidate;
            }

            return fileName;
        }