private static void Set_Builder_Folders(Builder_Settings SettingsObject, DataTable BuilderFoldersTable, Dictionary<int, List<Builder_Source_Folder>> FolderToSetDictionary) { SettingsObject.IncomingFolders.Clear(); foreach (DataRow thisRow in BuilderFoldersTable.Rows) { Builder_Source_Folder newFolder = new Builder_Source_Folder { Folder_Name = thisRow["FolderName"].ToString(), Inbound_Folder = thisRow["NetworkFolder"].ToString(), Failures_Folder = thisRow["ErrorFolder"].ToString(), Processing_Folder = thisRow["ProcessingFolder"].ToString(), Perform_Checksum = Convert.ToBoolean(thisRow["Perform_Checksum_Validation"]), Archive_TIFFs = Convert.ToBoolean(thisRow["Archive_TIFF"]), Archive_All_Files = Convert.ToBoolean(thisRow["Archive_All_Files"]), Allow_Deletes = Convert.ToBoolean(thisRow["Allow_Deletes"]), Allow_Folders_No_Metadata = Convert.ToBoolean(thisRow["Allow_Folders_No_Metadata"]), Allow_Metadata_Updates = Convert.ToBoolean(thisRow["Allow_Metadata_Updates"]), BibID_Roots_Restrictions = thisRow["BibID_Roots_Restrictions"].ToString(), Builder_Module_SetID = Convert.ToInt32(thisRow["ModuleSetID"]) }; //if (thisRow["Can_Move_To_Content_Folder"] == DBNull.Value) // newFolder.Can_Move_To_Content_Folder = null; //else // newFolder.Can_Move_To_Content_Folder = Convert.ToBoolean(thisRow["Can_Move_To_Content_Folder"]); if (( thisRow["ModuleSetID"] != null) && ( thisRow["ModuleSetID"].ToString().Length > 0 )) { int id = Int32.Parse(thisRow["ModuleSetID"].ToString()); if (FolderToSetDictionary.ContainsKey(id)) FolderToSetDictionary[id].Add(newFolder); else { FolderToSetDictionary[id] = new List<Builder_Source_Folder> {newFolder}; } } SettingsObject.IncomingFolders.Add(newFolder); } }
/// <summary> Constructor for a new instance of the Actionable_Builder_Source_Folder class </summary> /// <param name="ExistingBaseInstance"> An existing base instance used to populate this class with data </param> /// <param name="BuilderModulesConfig"> Builder module configuration to use to process this incoming folder structure </param> /// <remarks> This extends the core class <see cref="Builder_Source_Folder"/> and adds some methods to perform work </remarks> public Actionable_Builder_Source_Folder(Builder_Source_Folder ExistingBaseInstance, Builder_Modules BuilderModulesConfig ) { Allow_Deletes = ExistingBaseInstance.Allow_Deletes; Allow_Folders_No_Metadata = ExistingBaseInstance.Allow_Folders_No_Metadata; Allow_Metadata_Updates = ExistingBaseInstance.Allow_Metadata_Updates; Archive_All_Files = ExistingBaseInstance.Archive_All_Files; Archive_TIFFs = ExistingBaseInstance.Archive_TIFFs; BibID_Roots_Restrictions = ExistingBaseInstance.BibID_Roots_Restrictions; Failures_Folder = ExistingBaseInstance.Failures_Folder; Folder_Name = ExistingBaseInstance.Folder_Name; Inbound_Folder = ExistingBaseInstance.Inbound_Folder; Perform_Checksum = ExistingBaseInstance.Perform_Checksum; Processing_Folder = ExistingBaseInstance.Processing_Folder; BuilderModules = new List<iFolderModule>(); // Copy over the folder modules foreach (Builder_Module_Setting settings in ExistingBaseInstance.Builder_Module_Settings) { iFolderModule module = BuilderModulesConfig.Get_Folder_Module_By_Key(settings.Key); if (module != null) BuilderModules.Add(module); } }