/// <summary> /// Verifies the required files exist. If they do not and they have a file defination it will create the file. /// </summary> /// <returns>False if one of the MANDATORY files did not create</returns> public static bool Initialize() { bool noFailures = true; Type classType = typeof(FileLocations); foreach (PropertyInfo propertyInfo in classType.GetProperties()) { if (propertyInfo.PropertyType != typeof(FileLocationContainer)) { continue; } FileLocationContainer fileInfo = propertyInfo.GetValue(null) as FileLocationContainer; if (IoHelperMethods.FileExists(fileInfo.Path)) { continue; // Skip files that exist } // Try to create the file using the file defination if it has one if (fileInfo.FileDefination != null) { if (IoHelperMethods.CreateFile(fileInfo.Path, fileInfo.FileDefination, fileInfo.Required)) { continue; } } if (!fileInfo.Required) { continue; // if not required then continue because it's ok } noFailures = false; break; } return(noFailures); }