示例#1
0
        /// <summary>
        /// read file and folder settings with a provided settings path
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public static Entities.FileAndFolderSettings readFileAndFolderSettings(string path)
        {
            Entities.FileAndFolderSettings settings = new OpenChords.Entities.FileAndFolderSettings();
            if (!IO.FileFolderFunctions.isFilePresent(path))
            {
                new FileInfo(path).Directory.Create(); //create directory if it doesn't exist
                xmlWriter <FileAndFolderSettings>(path, settings);
            }
            else
            {
                try
                {
                    settings = xmlReader <FileAndFolderSettings>(path);
                }
                catch (Exception Ex)
                {
                    logger.Error("Error reading settings", Ex);
                }
            }

            return(settings);
        }
示例#2
0
 public static void setup(Entities.FileAndFolderSettings settings)
 {
     _fileAndFolderSettings = new Config.ExtAppsAndDirClass(settings);
 }