private static void SavePathSection(FilePathsHandler handler) { _config.Sections.Remove(FILE_PATH_SECTION); _config.Sections.Add(FILE_PATH_SECTION, handler); _config.Save(ConfigurationSaveMode.Modified); ConfigurationManager.RefreshSection(FILE_PATH_SECTION); }
private static FilePathsHandler CreateFilePathElement(string master, string production, int index) { FilePathsHandler handler = new FilePathsHandler(FilePathSection.FilePaths); handler.FilePathElement1 = FilePathSection.FilePathElement1; handler.FilePathElement2 = FilePathSection.FilePathElement2; handler.FilePathElement3 = FilePathSection.FilePathElement3; handler.FilePathElement4 = FilePathSection.FilePathElement4; handler.FilePathElement5 = FilePathSection.FilePathElement5; switch (index) { case 1: handler.FilePathElement1 = new FilePathsElementHandler(master, production); break; case 2: handler.FilePathElement2 = new FilePathsElementHandler(master, production); break; case 3: handler.FilePathElement3 = new FilePathsElementHandler(master, production); break; case 4: handler.FilePathElement4 = new FilePathsElementHandler(master, production); break; case 5: handler.FilePathElement5 = new FilePathsElementHandler(master, production); break; } return handler; }