Ejemplo n.º 1
0
 /// <summary>
 /// Creates the deep copy instance of this instance
 /// </summary>
 public MapperSettings DeepClone()
 {
     MapperSettings clonnedMapper = new MapperSettings();
     //Allowed pools
     foreach (KeyValuePair<string, List<AllowedPool>> keyValuePair in PoolsMap)
     {
         List<AllowedPool> clonnedAllowedPoolsList = new List<AllowedPool>(keyValuePair.Value.Count);
         foreach (AllowedPool allowedPool in keyValuePair.Value)
         {
             AllowedPool clonnedAllowedPool = new AllowedPool { _reservoirInstanceIdx = allowedPool._reservoirInstanceIdx, _poolIdx = allowedPool._poolIdx };
             clonnedAllowedPoolsList.Add(clonnedAllowedPool);
         }
         clonnedMapper.PoolsMap.Add(keyValuePair.Key, clonnedAllowedPoolsList);
     }
     //Allowed input fields
     foreach (KeyValuePair<string, List<int>> keyValuePair in RoutedInputFieldsMap)
     {
         List<int> clonnedAllowedRoutedInputFieldsIdxs = new List<int>(keyValuePair.Value.Count);
         foreach (int allowedRoutedInputFieldIdx in keyValuePair.Value)
         {
             clonnedAllowedRoutedInputFieldsIdxs.Add(allowedRoutedInputFieldIdx);
         }
         clonnedMapper.RoutedInputFieldsMap.Add(keyValuePair.Key, clonnedAllowedRoutedInputFieldsIdxs);
     }
     return clonnedMapper;
 }
Ejemplo n.º 2
0
 //Methods
 /// <summary>
 /// See the base.
 /// </summary>
 public override bool Equals(object obj)
 {
     if (obj == null) return false;
     AllowedPool cmpSettings = obj as AllowedPool;
     if (_reservoirInstanceIdx != cmpSettings._reservoirInstanceIdx ||
         _poolIdx != cmpSettings._poolIdx
         )
     {
         return false;
     }
     return true;
 }