/// <summary> /// Add a new source to be included in aggregation. /// </summary> /// <param name="bindable">The bindable to add.</param> public void AddSource(IBindable <T> bindable) { lock (sourceMapping) { if (findExistingPair(bindable) != null) { return; } var boundCopy = bindable.GetBoundCopy(); sourceMapping.Add(new WeakRefPair(new WeakReference <IBindable <T> >(bindable), boundCopy)); boundCopy.BindValueChanged(recalculateAggregate, true); } }
public void AttachUser(IBindable <APIUser> user) { Debug.Assert(localUser == null); localUser = user.GetBoundCopy(); localUser.BindValueChanged(u => { SentrySdk.ConfigureScope(scope => scope.User = new User { Username = u.NewValue.Username, Id = u.NewValue.Id.ToString(), }); }, true); }