Esempio n. 1
0
        /// <summary>
        /// Compares the value behind a key in two ParameterCollectionData.
        /// </summary>
        /// <param name="parameters0">The first ParameterCollectionData.</param>
        /// <param name="parameters1">The second ParameterCollectionData.</param>
        /// <param name="key">The ParameterKey.</param>
        /// <returns>True</returns>
        private static bool CompareKeyValue <T>(ParameterCollectionData parameters0, ParameterCollectionData parameters1, ParameterKey <T> key)
        {
            var value0 = parameters0.ContainsKey(key) ? parameters0[key] : key.DefaultMetadataT.DefaultValue;
            var value1 = parameters1.ContainsKey(key) ? parameters1[key] : key.DefaultMetadataT.DefaultValue;

            return(value0 == value1);
        }
 private static void SetShadowCasterReceiverConfiguration(ParameterCollectionData sourceParameters, ParameterCollectionData targetParameters, params ParameterKey[] keys)
 {
     if (sourceParameters != null)
     {
         foreach (var key in keys)
         {
             if (sourceParameters.ContainsKey(key))
             {
                 targetParameters.Set(key, sourceParameters[key]);
             }
         }
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Test if two ParameterCollectionData are equal
        /// </summary>
        /// <param name="parameters0">The first ParameterCollectionData.</param>
        /// <param name="parameters1">The second ParameterCollectionData.</param>
        /// <returns>True if the collections are the same, false otherwise.</returns>
        private static bool AreCollectionsEqual(ParameterCollectionData parameters0, ParameterCollectionData parameters1)
        {
            bool result = true;

            foreach (var paramKey in parameters0)
            {
                result &= parameters1.ContainsKey(paramKey.Key) && parameters1[paramKey.Key].Equals(paramKey.Value);
            }
            foreach (var paramKey in parameters1)
            {
                result &= parameters0.ContainsKey(paramKey.Key) && parameters0[paramKey.Key].Equals(paramKey.Value);
            }
            return(result);
        }