public RemoveBindingDisposable( LinkedListNode <PriorityBindingEntry> binding, LinkedList <PriorityBindingEntry> bindings, PriorityLevel priorityLevel) { _binding = binding; _bindings = bindings; _priorityLevel = priorityLevel; }
/// <summary> /// Called when a priority level encounters an error. /// </summary> /// <param name="level">The priority level of the changed entry.</param> /// <param name="error">The binding error.</param> public void LevelError(PriorityLevel level, BindingNotification error) { Logger.Log( LogEventLevel.Error, LogArea.Binding, Owner, "Error in binding to {Target}.{Property}: {Message}", Owner, Property, error.Error.Message); }
/// <summary> /// Called when a priority level encounters an error. /// </summary> /// <param name="level">The priority level of the changed entry.</param> /// <param name="error">The binding error.</param> public void LevelError(PriorityLevel level, BindingError error) { Logger.Log( LogEventLevel.Error, LogArea.Binding, _owner, "Error binding to {Target}.{Property}: {Message}", _owner, Property, error.Exception.Message); }
/// <summary> /// Gets the <see cref="PriorityLevel"/> with the specified priority, creating it if it /// doesn't already exist. /// </summary> /// <param name="priority">The priority.</param> /// <returns>The priority level.</returns> private PriorityLevel GetLevel(int priority) { PriorityLevel result; if (!_levels.TryGetValue(priority, out result)) { result = new PriorityLevel(this, priority); _levels.Add(priority, result); } return(result); }
/// <summary> /// Called when the value for a priority level changes. /// </summary> /// <param name="level">The priority level of the changed entry.</param> public void LevelValueChanged(PriorityLevel level) { if (level.Priority <= ValuePriority) { if (level.Value != AvaloniaProperty.UnsetValue) { UpdateValue(level.Value, level.Priority); } else { foreach (var i in _levels.Values.OrderBy(x => x.Priority)) { if (i.Value != AvaloniaProperty.UnsetValue) { UpdateValue(i.Value, i.Priority); return; } } UpdateValue(AvaloniaProperty.UnsetValue, int.MaxValue); } } }
/// <summary> /// Initializes a new instance of the <see cref="PriorityBindingEntry"/> class. /// </summary> /// <param name="owner">The owner.</param> /// <param name="index"> /// The binding index. Later bindings should have higher indexes. /// </param> public PriorityBindingEntry(PriorityLevel owner, int index) { _owner = owner; Index = index; }
/// <summary> /// Gets the <see cref="PriorityLevel"/> with the specified priority, creating it if it /// doesn't already exist. /// </summary> /// <param name="priority">The priority.</param> /// <returns>The priority level.</returns> private PriorityLevel GetLevel(int priority) { PriorityLevel result; if (!_levels.TryGetValue(priority, out result)) { result = new PriorityLevel(this, priority); _levels.Add(priority, result); } return result; }
/// <summary> /// Called when a priority level encounters an error. /// </summary> /// <param name="level">The priority level of the changed entry.</param> /// <param name="error">The binding error.</param> public void LevelError(PriorityLevel level, BindingNotification error) { Logger.Log( LogEventLevel.Error, LogArea.Binding, _owner, "Error in binding to {Target}.{Property}: {Message}", _owner, Property, error.Error.Message); }
/// <summary> /// Called whenever a priority level validation state changes. /// </summary> /// <param name="priorityLevel">The priority level of the changed entry.</param> /// <param name="validationStatus">The validation status.</param> public void LevelValidation(PriorityLevel priorityLevel, IValidationStatus validationStatus) { _owner.DataValidationChanged(this, validationStatus); }
/// <summary> /// Called when a priority level encounters an error. /// </summary> /// <param name="level">The priority level of the changed entry.</param> /// <param name="error">The binding error.</param> public void LevelError(PriorityLevel level, BindingNotification error) { error.LogIfError(Owner, Property); }