public static void TryRecordOrElseNotify<TOwner>(ScopeContext scopeContext, TOwner owner, string propertyName, NotifyCollectionChangedEventArgs args, bool isRecordingEnabled) where TOwner : IPropertyChangedNotifier { var notify = false; if (scopeContext != null && isRecordingEnabled) { scopeContext.Get<ScopeRecorder>() ?.Record(scopeContext, new CollectionChangeRecord(owner, propertyName, args)); if (!scopeContext.ContainsKey<PropertyNotificationScopeAspect>()) notify = true; } else notify = true; if (notify) PropertyNotificationManager<TOwner>.PropagateNotification(owner, propertyName); }
/// <summary> /// Returns true if the aspect name is on context /// </summary> /// <param name="context"><see cref="ScopeContext"/> dictionary </param> public virtual bool IsInscope(ScopeContext context) => context.ContainsKey(GetType().Name);