I'm currently trying to make a Logger for hundreds of classes, which listens for 3 property's change, and creates a log message if they do.
public class MementoLoggerUtility<SLOC, AVAL, BVAL>
{
private SLOC Loc;
private AVAL Val1;
private BVAL Val2;
/// <summary>
/// CTOR
/// </summary>
public MementoLoggerUtility(ref SLOC loc, ref AVAL val1, ref BVAL val2)
{
Loc = loc;
Val1 = val1;
Val2 = val2;
}
I would pass the 3 property in the listened object's constructor, but I need an OnPropertyChanged event into this class to listen on their changes.
(I can't write it to the listened object's property setter.)
Is this plan even possible to implement? If not, can you propose me another option?