Esempio n. 1
0
        /// <summary>
        /// Looks up a given <paramref name="file" /> in <see cref="Files.MulPath"/>
        /// </summary>
        /// <returns>The absolute path to <paramref name="file" /> -or- <c>null</c> if <paramref name="file" /> was not found.</returns>
        public static string GetFilePath(string file)
        {
            if (MulPath.Count > 0)
            {
                string path = "";
                if (MulPath.ContainsKey(file.ToLower()))
                {
                    path = MulPath[file.ToLower()];
                }
                if (String.IsNullOrEmpty(path))
                {
                    return(null);
                }
                if (String.IsNullOrEmpty(Path.GetDirectoryName(path)))
                {
                    path = Path.Combine(m_RootDir, path);
                }
                if (File.Exists(path))
                {
                    return(path);
                }
            }

            return(null);
        }
Esempio n. 2
0
        /// <summary>
        ///     Looks up a given <paramref name="file" /> in <see cref="Files.MulPath" />
        /// </summary>
        /// <returns>
        ///     The absolute path to <paramref name="file" /> -or- <c>null</c> if <paramref name="file" /> was not found.
        /// </returns>
        public static string GetFilePath(string file)
        {
            if (MulPath.Count == 0)
            {
                return(null);
            }

            string path = string.Empty;

            if (MulPath.ContainsKey(file.ToLower()))
            {
                path = MulPath[file.ToLower()];
            }

            if (string.IsNullOrEmpty(path))
            {
                return(null);
            }

            if (string.IsNullOrEmpty(Path.GetDirectoryName(path)))
            {
                path = Path.Combine(RootDir, path);
            }

            return(File.Exists(path) ? path : null);
        }