Beispiel #1
0
 /// <summary>
 /// Creates a new mutator which populates a collection's items.
 /// </summary>
 private static UvmlMutator CreateMutatorForCollection(UltravioletContext uv,
                                                       UvmlMutatorTarget targetKind, Object target, IEnumerable <UvmlNode> items)
 {
     if (targetKind == UvmlMutatorTarget.StandardProperty)
     {
         return(new UvmlStandardPropertyCollectionItemMutator((PropertyInfo)target, items));
     }
     else
     {
         return(new UvmlDependencyPropertyCollectionItemMutator((DependencyProperty)target, items));
     }
 }
Beispiel #2
0
        /// <summary>
        /// Creates a new mutator from the specified target information.
        /// </summary>
        private static UvmlMutator CreateMutatorForTarget(
            UvmlMutatorTarget targetKind, Type templatedParentType, Type templatedObjectType, Object target, UvmlNode value)
        {
            switch (targetKind)
            {
            case UvmlMutatorTarget.DependencyProperty:
                return(new UvmlDependencyPropertyValueMutator((DependencyProperty)target, value));

            case UvmlMutatorTarget.DependencyPropertyBinding:
                return(new UvmlDependencyPropertyBindingMutator((DependencyProperty)target, value));

            case UvmlMutatorTarget.RoutedEvent:
                return(new UvmlRoutedEventHandlerMutator((RoutedEvent)target, value));

            case UvmlMutatorTarget.StandardProperty:
                return(new UvmlStandardPropertyValueMutator((PropertyInfo)target, value));

            case UvmlMutatorTarget.StandardEvent:
                return(new UvmlStandardEventHandlerMutator((EventInfo)target, value));
            }

            throw new NotSupportedException();
        }
Beispiel #3
0
        /// <summary>
        /// Creates a new mutator from the specified target information.
        /// </summary>
        private static UvmlMutator CreateMutatorForTarget(
            UvmlMutatorTarget targetKind, Type templatedParentType, Type templatedObjectType, Object target, UvmlNode value)
        {
            switch (targetKind)
            {
                case UvmlMutatorTarget.DependencyProperty:
                    return new UvmlDependencyPropertyValueMutator((DependencyProperty)target, value);

                case UvmlMutatorTarget.DependencyPropertyBinding:
                    return new UvmlDependencyPropertyBindingMutator((DependencyProperty)target, value);

                case UvmlMutatorTarget.RoutedEvent:
                    return new UvmlRoutedEventHandlerMutator((RoutedEvent)target, value);

                case UvmlMutatorTarget.StandardProperty:
                    return new UvmlStandardPropertyValueMutator((PropertyInfo)target, value);

                case UvmlMutatorTarget.StandardEvent:
                    return new UvmlStandardEventHandlerMutator((EventInfo)target, value);
            }

            throw new NotSupportedException();
        }
Beispiel #4
0
 /// <summary>
 /// Creates a new mutator which populates a collection's items.
 /// </summary>
 private static UvmlMutator CreateMutatorForCollection(UltravioletContext uv,
     UvmlMutatorTarget targetKind, Object target, IEnumerable<UvmlNode> items)
 {
     if (targetKind == UvmlMutatorTarget.StandardProperty)
     {
         return new UvmlStandardPropertyCollectionItemMutator((PropertyInfo)target, items);
     }
     else
     {
         return new UvmlDependencyPropertyCollectionItemMutator((DependencyProperty)target, items);
     }
 }