/// <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)); } }
/// <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(); }
/// <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(); }
/// <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); } }