public async ValueTask SetReadValue(string value, DateTime timestamp) { //Logger?.LogTrace("SetReadValue: " + value); Value = value; Timestamp = timestamp; if (OldValue.Equals(Value)) { } else { OldValue = Value; //if (Invoke && (InputOutput.Equals("R") || InputOutput.Equals("RW"))) //{ //Logger.Trace("Domain Tag: " + Name + " - " + Value); //TagGroup.EventBus?.Publish(TagReadEvent); if (NotifierMediatorService != null /*&& Invoke*/) { //Logger.LogCritical("Domain Tag Publish! " + Name + " " + Value); await NotifierMediatorService .NotifyAsync(new TagValueChanged( /*Logger,*/ this, Name, Value, Timestamp)) .ConfigureAwait(false); //Logger.LogTrace("Domain Tag Publish! " + Name + " " + Value); } //} } }//SetReadValue
public bool HasChanged() { if ((OldValue != null && !OldValue.Equals(NewValue)) || (OldValue == null && NewValue != null)) { return(true); } return(false); }
public ONBool CheckValues() { if (!OldValue.Equals(NewValue)) { return(new ONBool(false)); } else { return(new ONBool(true)); } }
/// <summary> /// /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(Detail other) { if (other == null) { return(false); } return((Property != null ? Property.Equals(other.Property) : other.Property == null) && (Name != null ? Name.Equals(other.Name) : other.Name == null) && (OldValue != null ? OldValue.Equals(other.OldValue) : other.OldValue == null) && (NewValue != null ? NewValue.Equals(other.NewValue) : other.NewValue == null)); }
/// <summary> /// /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(Detail other) { if (other == null) { return(false); } return((Property?.Equals(other.Property) ?? other.Property == null) && (Name?.Equals(other.Name) ?? other.Name == null) && (OldValue?.Equals(other.OldValue) ?? other.OldValue == null) && (NewValue?.Equals(other.NewValue) ?? other.NewValue == null)); }
public bool Equals(Detail other) { if (other == null) { return(false); } return(Property.Equals(other.Property) && StatusId.Equals(other.StatusId) && OldValue.Equals(other.OldValue) && NewValue.Equals(other.NewValue)); }
public bool IsChanged() { if (OldValue == null && NewValue == null) { return(false); } if (OldValue == null ^ NewValue == null) { return(true); } return(!OldValue.Equals(NewValue)); }
public bool HasChanged(object source) { OldValue = NewValue; NewValue = Property.GetValue(source); if (OldValue != null) { return(!OldValue.Equals(NewValue)); } if (NewValue != null) { return(!NewValue.Equals(OldValue)); } return(false); }
public override bool Equals(object obj) { if (!(obj is Change change)) { return(false); } if (OldValue == null) { return(change.OldValue == null); } if (NewValue == null) { return(change.NewValue == null); } return (PropertyPath == change.PropertyPath && OldValue.Equals(change.OldValue) && NewValue.Equals(change.NewValue)); }
/// <summary>Determines whether the provided <see cref="T:System.Windows.DependencyPropertyChangedEventArgs" /> is equivalent to the current <see cref="T:System.Windows.DependencyPropertyChangedEventArgs" />.</summary> /// <param name="args">The <see cref="T:System.Windows.DependencyPropertyChangedEventArgs" /> to compare to the current <see cref="T:System.Windows.DependencyPropertyChangedEventArgs" /></param> /// <returns> /// <see langword="true" /> if the provided <see cref="T:System.Windows.DependencyPropertyChangedEventArgs" /> is equivalent to the current <see cref="T:System.Windows.DependencyPropertyChangedEventArgs" />; otherwise, <see langword="false" />.</returns> public bool Equals(DependencyPropertyChangedEventArgs <TValue> args) => Property.Equals(args.Property) && OldValue.Equals(args.OldValue) && NewValue.Equals(args.NewValue);
/// <summary> /// Checks whether the replacement will have any effect. /// </summary> /// <returns></returns> internal bool IsIdentity() { return(OldValue.Equals(NewValue)); }