public void MappingIfContainsKey(string inputEntityLogicalName, Dictionary <string, List <Item <EntityReference, EntityReference> > > inputMapping, Dictionary <string, Dictionary <Guid, Guid> > inputMapper, Form parentForm) { using (var mappingDialog = new MappingList(inputMapping[inputEntityLogicalName]) { StartPosition = FormStartPosition.CenterParent }) { if (parentForm != null) { mappingDialog.ShowDialog(parentForm); } var mapList = mappingDialog.GetMappingList(inputEntityLogicalName); var guidMapList = mappingDialog.GetGuidMappingList(); if (mapList.Count == 0) { inputMapping.Remove(inputEntityLogicalName); inputMapper.Remove(inputEntityLogicalName); } else { inputMapping[inputEntityLogicalName] = mapList; inputMapper[inputEntityLogicalName] = guidMapList; } } }
private void btnMappings_Click(object sender, EventArgs e) { var entities = Entities.ToArray(); var mappingDialog = new MappingList(entities, settings[organisationid].Mappings); mappingDialog.ShowDialog(ParentForm); settings[organisationid].Mappings = mappingDialog.GetMappingList(); InitMappings(); }
public void MappingIfKeyDoesNotExist(string inputEntityLogicalName, Dictionary <string, List <Item <EntityReference, EntityReference> > > inputMapping, Dictionary <string, Dictionary <Guid, Guid> > inputMapper, Form parentForm) { var mappingReference = new List <Item <EntityReference, EntityReference> >(); using (var mappingDialog = new MappingList(mappingReference) { StartPosition = FormStartPosition.CenterParent }) { if (parentForm != null) { mappingDialog.ShowDialog(parentForm); } var mapList = mappingDialog.GetMappingList(inputEntityLogicalName); var guidMapList = mappingDialog.GetGuidMappingList(); if (mapList.Count > 0) { inputMapping.Add(inputEntityLogicalName, mapList); inputMapper.Add(inputEntityLogicalName, guidMapList); } } }