AIT.Tools.VisualStudioTextTransform.VisualStudioTextTemplateHost.ResolvePath C# (CSharp) Method

ResolvePath() public method

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 path ) : string
path string
return string
        public string ResolvePath(string path)
        {
            if (path == null)
            {
                throw new ArgumentNullException("path", Resources.VisualStudioTextTemplateHost_ResolvePath_the_file_name_cannot_be_null);
            }

            var resolveAllPathsPrivate = ResolveAllPathsPrivate(path).ToList();
            var resolvedPath = resolveAllPathsPrivate.FirstOrDefault(p => Directory.Exists(p) || File.Exists(p));
            if (resolvedPath != null)
            {
                Source.TraceEvent(TraceEventType.Verbose, 1, "Using existing path: {0}", resolvedPath);
                return resolvedPath;
            }

            throw new ArgumentException("Could not resolve path: " + path);
        }