Exemplo n.º 1
0
 /// <summary>
 /// Sets the Mapped Thing on enum values of the provided row
 /// </summary>
 /// <param name="dataTypeDefinitionMap"></param>
 /// <param name="row"></param>
 private void PopulateEnumRow(DatatypeDefinitionMap dataTypeDefinitionMap, DatatypeDefinitionMappingRowViewModel row)
 {
     foreach (var enumRow in row.EnumValue)
     {
         if (dataTypeDefinitionMap.EnumValueMap.TryGetValue(enumRow.Identifiable, out var enumValueDef))
         {
             enumRow.MappedThing = enumRow.PossibleThings.Single(x => x.Iid == enumValueDef.Iid);
         }
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Populate the result of the mapping from the row data
        /// </summary>
        private void PopulateMap()
        {
            this.map = new Dictionary <DatatypeDefinition, DatatypeDefinitionMap>();
            foreach (var row in this.MappingRows)
            {
                var enumMap = new Dictionary <EnumValue, EnumerationValueDefinition>();
                foreach (var enumValueRow in row.EnumValue)
                {
                    enumMap.Add(enumValueRow.Identifiable, enumValueRow.MappedThing);
                }

                var defMap = new DatatypeDefinitionMap(row.Identifiable, row.MappedThing, enumMap);
                this.map.Add(row.Identifiable, defMap);
            }
        }