Fizzi.Applications.ChallongeVisualization.Model.ObservableMatch.Update C# (CSharp) Method

Update() public method

public Update ( Match newData ) : void
newData Fizzi.Libraries.ChallongeApiWrapper.Match
return void
        public void Update(Match newData)
        {
            var oldData = source;
            source = newData;

            //Raise notify event for any property that has changed value
            foreach (var property in matchProperties)
            {
                if (!object.Equals(property.GetValue(oldData, null), property.GetValue(newData, null))) this.Raise(property.Name, PropertyChanged);
            }

            //Always raise the TimeSinceAvailable property if StatedAt is not null
            if (StartedAt.HasValue)
            {
                this.Raise("TimeSinceAvailable", PropertyChanged);
            }
        }