public static IVault ValueMetadataChanged(this IVault vault, Action<ValueChangedEventArgs> listener)
 {
     return vault.Changed(
         e => e.Subject is IValue && e.Reason == EventReason.Metadata,
         e => listener(new ValueChangedEventArgs(e.CorrelationId, e.Reason, (IValue)e.Subject, e.OldRevision, e.OldValue, e.NewValue)));
 }
 public static IVault ValueChanged(this IVault vault, Func<ValueChangedEventArgs, bool> filter, Action<ValueChangedEventArgs> listener)
 {
     return vault.Changed(
         e => e.Subject is IValue && filter(new ValueChangedEventArgs(e.CorrelationId, e.Reason, (IValue)e.Subject, e.OldRevision, e.OldValue, e.NewValue)),
         e => listener(new ValueChangedEventArgs(e.CorrelationId, e.Reason, (IValue)e.Subject, e.OldRevision, e.OldValue, e.NewValue)));
 }
 public static IVault Changed(this IVault vault, Action<ElementChangedEventArgs> listener)
 {
     return vault.Changed(e => true, listener);
 }
 public static IVault BranchElementRemoved(this IVault vault, Action<BranchChangedEventArgs> listener)
 {
     return vault.Changed(
         e => e.Subject is IBranch && e.Reason == EventReason.ElementRemove,
         e => listener(new BranchChangedEventArgs(e.CorrelationId, e.Reason, (IBranch)e.Subject, e.OldRevision, e.OldValue, e.NewValue)));
 }