Browse Source

Remove unused code.

pull/8600/head
Steven Kirk 3 years ago
parent
commit
bfa6648441
  1. 23
      src/Avalonia.Base/PropertyStore/EffectiveValue.cs
  2. 28
      src/Avalonia.Base/PropertyStore/EffectiveValue`1.cs

23
src/Avalonia.Base/PropertyStore/EffectiveValue.cs

@ -19,12 +19,6 @@ namespace Avalonia.PropertyStore
/// </summary>
public object? Value => GetBoxedValue();
/// <summary>
/// Gets the current effective base value as a boxed value, or
/// <see cref="AvaloniaProperty.UnsetValue"/> if not set.
/// </summary>
public object? BaseValue => GetBoxedBaseValue();
/// <summary>
/// Gets the priority of the current effective value.
/// </summary>
@ -86,22 +80,6 @@ namespace Avalonia.PropertyStore
IValueEntry value,
BindingPriority priority);
/// <summary>
/// Sets the value and base value for a non-LocalValue priority, raising
/// <see cref="AvaloniaObject.PropertyChanged"/> where necessary.
/// </summary>
/// <param name="owner">The associated value store.</param>
/// <param name="value">The new value of the property.</param>
/// <param name="priority">The priority of the new value.</param>
/// <param name="baseValue">The new base value of the property.</param>
/// <param name="basePriority">The priority of the new base value.</param>
public abstract void SetAndRaise(
ValueStore owner,
IValueEntry value,
BindingPriority priority,
IValueEntry baseValue,
BindingPriority basePriority);
/// <summary>
/// Raises <see cref="AvaloniaObject.PropertyChanged"/> in response to an inherited value
/// change.
@ -140,7 +118,6 @@ namespace Avalonia.PropertyStore
public abstract void DisposeAndRaiseUnset(ValueStore owner, AvaloniaProperty property);
protected abstract object? GetBoxedValue();
protected abstract object? GetBoxedBaseValue();
protected void UpdateValueEntry(IValueEntry? entry, BindingPriority priority)
{

28
src/Avalonia.Base/PropertyStore/EffectiveValue`1.cs

@ -26,6 +26,7 @@ namespace Avalonia.PropertyStore
{
Value = value;
Priority = priority;
BasePriority = BindingPriority.Unset;
if (property.HasCoercion &&
property.GetMetadata(owner.GetType()) is { } metadata &&
@ -40,17 +41,6 @@ namespace Avalonia.PropertyStore
value = coerce(owner, value);
}
if (priority >= BindingPriority.LocalValue && priority < BindingPriority.Inherited)
{
_baseValue = value;
BasePriority = priority;
}
else
{
_baseValue = default;
BasePriority = BindingPriority.Unset;
}
}
/// <summary>
@ -68,17 +58,6 @@ namespace Avalonia.PropertyStore
SetAndRaiseCore(owner, (StyledPropertyBase<T>)value.Property, (T)value.GetValue()!, priority);
}
public override void SetAndRaise(
ValueStore owner,
IValueEntry value,
BindingPriority priority,
IValueEntry baseValue,
BindingPriority basePriority)
{
Debug.Assert(priority != BindingPriority.LocalValue);
SetAndRaiseCore(owner, (StyledPropertyBase<T>)value.Property, (T)value.GetValue()!, priority, (T)baseValue!, basePriority);
}
public void SetLocalValueAndRaise(
ValueStore owner,
StyledPropertyBase<T> property,
@ -165,11 +144,6 @@ namespace Avalonia.PropertyStore
protected override object? GetBoxedValue() => Value;
protected override object? GetBoxedBaseValue()
{
return BasePriority != BindingPriority.Unset ? _baseValue : AvaloniaProperty.UnsetValue;
}
private void SetAndRaiseCore(
ValueStore owner,
StyledPropertyBase<T> property,

Loading…
Cancel
Save