Beispiel #1
0
        public static Preferences GetPreferences(string projectPath, string propertiesName, string userPropertiesName)
        {
            string propertiesPath     = $@"{projectPath}\{propertiesName}";
            string userPropertiesPath = $@"{projectPath}\{userPropertiesName}";

            if (!File.Exists(propertiesPath) || !File.Exists(userPropertiesPath))
            {
                throw new FileNotFoundException($"Could not find \"{propertiesPath}\" or \"{userPropertiesPath}\".");
            }
            var preferences = new Preferences(propertiesPath, userPropertiesPath);

            preferences
            .AppendProjectPath(SEARCH_PATHS, projectPath)
            .AppendProjectPath(PROJECT_PATH, projectPath)
            .AppendProjectPath(TARGET_DIRECTORY, projectPath);
            return(preferences);
        }