private void _notifyClient(object o, EventArgs e, string eventName)
        {
            if (!(o is IDto dto))
            {
                return;
            }
            EventArgs eventArgs;

            if (e is PropertyChangedEventArgs ea && eventName == nameof(INotifyPropertyChanged.PropertyChanged))
            {
                PropertyInfo p = o.GetType().GetProperty(ea.PropertyName);
                if (p?.CanRead == true)
                {
                    eventArgs = PropertyChangedWithDataEventArgs.Create(ea.PropertyName, p.GetValue(o, null));
                }
                else
                {
                    eventArgs = PropertyChangedWithDataEventArgs.Create(ea.PropertyName, null);
                    Debug.WriteLine(o, $"{GetType()}: Couldn't get value of {ea.PropertyName}");
                }
                Debug.WriteLine($"Server: PropertyChanged {ea.PropertyName} on {dto} sent");
            }
Esempio n. 2
0
        private void NotifyClient(object o, EventArgs e, string eventName)
        {
            if (!(o is IDto dto))
            {
                return;
            }
            //Debug.Assert(_referenceResolver.ResolveReference(dto.DtoGuid) != null, "Null reference notified");
            EventArgs eventArgs;

            if (e is PropertyChangedEventArgs ea && eventName == nameof(INotifyPropertyChanged.PropertyChanged))
            {
                var p = o.GetType().GetProperty(ea.PropertyName);
                if (p?.CanRead == true)
                {
                    eventArgs = PropertyChangedWithDataEventArgs.Create(ea.PropertyName, p.GetValue(o, null));
                }
                else
                {
                    eventArgs = PropertyChangedWithDataEventArgs.Create(ea.PropertyName, null);
                    Debug.WriteLine(o, $"{GetType()}: Couldn't get value of {ea.PropertyName}");
                }
                Debug.WriteLine($"Server: PropertyChanged {ea.PropertyName} on {dto} sent");
            }