< Summary

Information
Class: MyNet.Messaging.PropertyChangedMessage<T>
Assembly: MyNet.Messaging
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Messaging/PropertyChangedMessage.cs
Tag: 323_28699572109
Line coverage
0%
Covered lines: 0
Uncovered lines: 12
Coverable lines: 12
Total lines: 80
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
.ctor(...)100%210%
.ctor(...)100%210%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Messaging/PropertyChangedMessage.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="PropertyChangedMessage.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7namespace MyNet.Messaging;
 8
 9/// <summary>
 10/// Passes a string property name (PropertyName) and a generic value
 11/// (<see cref="OldValue" /> and <see cref="NewValue" />) to a recipient.
 12/// This message type can be used to propagate a PropertyChanged event to
 13/// a recipient using the messenging system.
 14/// </summary>
 15/// <typeparam name="T">The type of the OldValue and NewValue property.</typeparam>
 16public class PropertyChangedMessage<T> : PropertyChangedMessageBase
 17{
 18    /// <summary>
 19    /// Initializes a new instance of the <see cref="PropertyChangedMessage{T}" /> class.
 20    /// </summary>
 21    /// <param name="sender">The message's sender.</param>
 22    /// <param name="oldValue">The property's value before the change occurred.</param>
 23    /// <param name="newValue">The property's value after the change occurred.</param>
 24    /// <param name="propertyName">The name of the property that changed.</param>
 25    public PropertyChangedMessage(object sender, T? oldValue, T? newValue, string propertyName)
 026        : base(sender, propertyName)
 27    {
 028        OldValue = oldValue;
 029        NewValue = newValue;
 030    }
 31
 32    /// <summary>
 33    /// Initializes a new instance of the <see cref="PropertyChangedMessage{T}" /> class.
 34    /// </summary>
 35    /// <param name="oldValue">The property's value before the change occurred.</param>
 36    /// <param name="newValue">The property's value after the change occurred.</param>
 37    /// <param name="propertyName">The name of the property that changed.</param>
 38    public PropertyChangedMessage(T? oldValue, T? newValue, string propertyName)
 039        : base(propertyName)
 40    {
 041        OldValue = oldValue;
 042        NewValue = newValue;
 043    }
 44
 45    /// <summary>
 46    /// Initializes a new instance of the <see cref="PropertyChangedMessage{T}" /> class.
 47    /// </summary>
 48    /// <param name="sender">The message's sender.</param>
 49    /// <param name="target">The message's intended target. This parameter can be used
 50    /// to give an indication as to whom the message was intended for. Of course
 51    /// this is only an indication, amd may be null.</param>
 52    /// <param name="oldValue">The property's value before the change occurred.</param>
 53    /// <param name="newValue">The property's value after the change occurred.</param>
 54    /// <param name="propertyName">The name of the property that changed.</param>
 55    public PropertyChangedMessage(object sender, object target, T? oldValue, T? newValue, string propertyName)
 056        : base(sender, target, propertyName)
 57    {
 058        OldValue = oldValue;
 059        NewValue = newValue;
 060    }
 61
 62    /// <summary>
 63    /// Gets the value that the property has after the change.
 64    /// </summary>
 65    public T? NewValue
 66    {
 67        get;
 68        private set;
 69    }
 70
 71    /// <summary>
 72    /// Gets the value that the property had before the change.
 73    /// </summary>
 74    public T? OldValue
 75    {
 76        get;
 77        private set;
 78    }
 79}
 80