private void DeserializeComplexNode(IDeserializerNode node, Reader reader) { if (TryDeserializeAsReference(node, reader)) { return; } var jobj = reader.Token as JObject; if (jobj == null) { throw new PomonaSerializationException( "Trying to deserialize to complex type, expected a JSON object type but got " + reader.Token.Type); } SetNodeValueType(node, jobj); if (node.Operation == DeserializerNodeOperation.Default) { node.Operation = node.Value == null ? DeserializerNodeOperation.Post : DeserializerNodeOperation.Patch; } var propertyValueSource = new PropertyValueSource(jobj, node, this); propertyValueSource.Deserialize(); }
public void SetValueSource(PropertyInfo propertyInfo, PropertyValueSource source) { if (propertyInfo == null) { throw Logger.Fatal.ArgumentNull(nameof(propertyInfo)); } _sources[propertyInfo] = source; }
public void SetValue(ITrackValueSource target, Object value, PropertyValueSource source) { if (target == null) { throw Logger.Fatal.ArgumentNull(nameof(target)); } Setter(target, value); SetValueSource(target, source); }
public PropertyValueSource GetValueSource(PropertyInfo propertyInfo) { if (propertyInfo == null) { throw Logger.Fatal.ArgumentNull(nameof(propertyInfo)); } PropertyValueSource result = null; _sources.TryGetValue(propertyInfo, out result); return(result); }
private void SetValueSource(ITrackValueSource target, PropertyValueSource source) { target.SetValueSource(PropertyInfo, source); }
// Clear value-related things that this class caches public void ClearValueRelatedCacheItems() { _subProperties = null; _collection = null; _standardValues = null; _standardValuesExclusive = null; _converter = null; _commonValueType = null; _source = null; _isReadOnly = null; _valueSerializer = null; ClearSubValueRelatedCacheItems(); _parent.OnPropertyChanged("StandardValues"); _parent.OnPropertyChanged("StandardValuesExclusive"); _parent.OnPropertyChanged("Converter"); _parent.OnPropertyChanged("CommonValueType"); _parent.OnPropertyChanged("IsReadOnly"); // The following properties are only exposed by ModelPropertyEntry, not PropertyEntry. // People should bind to these properties through the PropertyValue. // However, if they ---- up in Xaml, the binding will still work and if that happens // we should try to update them when things change. _parent.OnPropertyChanged("SubProperties"); _parent.OnPropertyChanged("Collection"); _parent.OnPropertyChanged("Source"); }
public void SetValueSource(PropertyInfo propertyInfo, PropertyValueSource source) { _tracker.SetValueSource(propertyInfo, source); }
public RunSharpBasedSecondsParameter(PropertyValueSource <int> prop) { _prop = prop; }
public void SetValue(ITrackValueSource target, Object value, PropertyValueSource source) => PropertyAccessor.SetValue(target, value, source);
// <summary> // Returns the property source based on the following heuristic (in line with // Blend's behavior): // // Xaml Source // ------------------------------------------------------------------- // "123" Local // "{Binding}" DataBound // not specified (default value) Default // not specified (inherited value) Inherited // not specified (from style) Inherited // "{DynamicResource ...}" LocalDynamicResource // "{StaticResource ...}" LocalStaticResource // "{x:Static ...}" SystemResource // "{TemplateBinding ...}" TemplateBinding // "{CustomMarkup ...}" CustomMarkupExtension // // </summary> // <param name="property">Property to examine</param> // <returns>Source of the specified property, if any</returns> public static PropertyValueSource GetPropertySource(ModelProperty property) { if (property == null) { return(null); } ModelItem valueItem = property.Value; PropertyValueSource source = null; // Binding or any other known markup extension? if (valueItem != null) { Type valueType = valueItem.ItemType; if (IsStaticExtension(valueType)) { source = DependencyPropertyValueSource.SystemResource; } else if (typeof(StaticResourceExtension).IsAssignableFrom(valueType)) { source = DependencyPropertyValueSource.LocalStaticResource; } else if (typeof(DynamicResourceExtension).IsAssignableFrom(valueType)) { source = DependencyPropertyValueSource.LocalDynamicResource; } else if (typeof(TemplateBindingExtension).IsAssignableFrom(valueType)) { source = DependencyPropertyValueSource.TemplateBinding; } else if (typeof(Binding).IsAssignableFrom(valueType)) { source = DependencyPropertyValueSource.DataBound; } else if (typeof(MarkupExtension).IsAssignableFrom(valueType)) { source = DependencyPropertyValueSource.CustomMarkupExtension; } } // If not, is this a local, inherited, or default value? if (source == null) { if (property.IsSet) { source = DependencyPropertyValueSource.Local; } else { object value = property.ComputedValue; if (object.Equals(value, property.DefaultValue)) { source = DependencyPropertyValueSource.DefaultValue; } else if (valueItem != null && valueItem.Source != property) { source = DependencyPropertyValueSource.Inherited; } } } return(source); }
public RunSharpBasedParameter(PropertyValueSource <T> prop) { _prop = prop; }
void ITrackValueSource.SetValueSource(PropertyInfo property, PropertyValueSource source) => ValueSourceTracker.SetValueSource(property, source);