/// <summary> /// Execute the operation on the data. /// </summary> /// <param name="data"></param> public void Execute(GeneticData data) { IList<KeyValuePair<String, IDeepClonable>> updates = new List<KeyValuePair<String, IDeepClonable>>(); foreach (KeyValuePair<String, IDeepClonable> entry in data) { // Vérification if (TargetedGenes.Contains(entry.Key) && computeType == entry.Value.GetType()) { updates.Add(new KeyValuePair<String, IDeepClonable>(entry.Key, (IDeepClonable)Compute(entry.Value))); } } // Applying the updates. foreach (KeyValuePair<String, IDeepClonable> entry in updates) { data.Set(entry.Key, entry.Value); } }