Exemple #1
0
 protected internal void AddEvent(CompositeEventType eventType, string path, object eventData)
 {
     CompositeRoot?.DoAddEvent(new CompositeEvent(eventType, path, eventData, CompositeRoot?.CompositeRootSession?.Token,
                                                  CompositeRoot != null && CompositeRoot.CompositeRootSession != null ?
                                                  CompositeRoot.CompositeRootSession.Mode :
                                                  CompositeRootMode.None));
 }
Exemple #2
0
        protected virtual void NotifyPropertyChanged(string propertyName)
        {
            var property = GetType().GetProperty(propertyName);

            if (property == null)
            {
                throw new ArgumentException(propertyName);
            }

            var propertyValue = property.GetValue(this);

            _propertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
            CompositeRoot?.DoAddEvent(new CompositeEvent(CompositeEventType.Change, this.GetPropertyPath(property),
                                                         propertyValue,
                                                         CompositeRoot?.CompositeRootSession?.Token,
                                                         CompositeRoot != null && CompositeRoot.CompositeRootSession != null ?
                                                         CompositeRoot.CompositeRootSession.Mode :
                                                         CompositeRootMode.None));
        }