Esempio n. 1
0
        public IEnumerable <string> GetSearchPaths(string resourcePath)
        {
            if (resourcePath != null && resourcePath.Length == 0)
            {
                throw new ArgumentException(
                          "Resource path must not be empty.  Use null to get search paths without a particular resource specified.",
                          "resourcePath");
            }

            return(ResourceSearchRules.GetSearchPaths(baseDirectory, probingPaths, resourcePath));
        }
Esempio n. 2
0
        private static string ProbeForCodeBase(DirectoryInfo baseDirectory, IList <string> probingPaths, string codeBase, ICollection <string> attemptedPaths)
        {
            foreach (string searchPath in ResourceSearchRules.GetSearchPaths(baseDirectory, probingPaths, codeBase))
            {
                attemptedPaths.Add(searchPath);

                if (System.IO.File.Exists(searchPath))
                {
                    return(searchPath);
                }
            }

            return(null);
        }
Esempio n. 3
0
        private static string ProbeForCodeBase(DirectoryInfo baseDirectory, IList <string> probingPaths, string codeBase, ICollection <string> attemptedPaths)
        {
            /*if (codeBase.ToLower().Contains("autocad"))
             *  System.Windows.Forms.MessageBox.Show("ProbeForCodeBase autocad");*/
            foreach (string searchPath in ResourceSearchRules.GetSearchPaths(baseDirectory, probingPaths, codeBase))
            {
                attemptedPaths.Add(searchPath);

                if (System.IO.File.Exists(searchPath))
                {
                    return(searchPath);
                }
            }

            return(null);
        }