internal void ProcessMappingRemoval(FieldMapping currentFieldMappingControl, System.Windows.Forms.Control.ControlCollection parentContainer, FieldMappingEventArgs e) { try { //Add back any selected mappings to the relevant master collection, and remove them as well foreach (Control c in parentContainer) { if (c.GetType() == typeof(FieldMapping)) { FieldMapping fm = (FieldMapping)c; if (fm != currentFieldMappingControl) { if (e.OCMField != null) { fm.AddOCMField(e.OCMField); } if (e.BCMField != null) { fm.AddBCMField(e.BCMField); } } } } parentContainer.Remove(currentFieldMappingControl); } catch (Exception ex) { Log.Error(ex); } }
internal void ProcessDestinationFieldChange(FieldMapping currentFieldMappingControl, System.Windows.Forms.Control.ControlCollection parentContainer, FieldMappingEventArgs e) { try { foreach (Control c in parentContainer) { if (c.GetType() == typeof(FieldMapping)) { FieldMapping fm = (FieldMapping)c; if (fm != currentFieldMappingControl) { //Add or remove the field that was changed and update relevant DestinationFields/SourceFields collection and combo switch (e.ChangeType) { case FieldMappingEventArgs.ChangeTypes.Added: fm.RemoveOCMField(e.OCMField); break; case FieldMappingEventArgs.ChangeTypes.Removed: fm.AddOCMField(e.OCMField); break; } } } } } catch (Exception ex) { Log.Error(ex); } }