Exemplo n.º 1
0
        // Merge properties from a source to a target, preferring the existing properties
        // on the target if there are any duplicates.
        private static void MergeProperties(PropertyBagHolder target, PropertyBagHolder source)
        {
            // Are there any properties to merge?
            if (source.Properties != null)
            {
                // If so, make sure there's someplace to put them.
                if (target.Properties == null)
                {
                    target.Properties = new Dictionary <string, SerializedPropertyInfo>();
                }

                target.Properties = target.Properties.MergePreferFirst(source.Properties);
            }
        }
 private T GetPropertyFromHolder <T>(PropertyBagHolder holder)
 {
     try
     {
         return(holder.TryGetProperty(_propertyName, out T value) ? value : default);
        private T GetProperty <T>(Result result)
        {
            PropertyBagHolder holder = GetPropertyBagHolder(result);

            return(GetPropertyFromHolder <T>(holder));
        }