protected void TriggerDisabledChange(bool propagateToBindings = true)
 {
     DisabledChanged?.Invoke(disabled);
     if (propagateToBindings)
     {
         bindings?.ForEachAlive(b => b.Disabled = disabled);
     }
 }
Exemple #2
0
 internal void SetDisabled(bool disabled)
 {
     if (_disabled.GetAndSet(disabled) != disabled)
     {
         DisabledChanged?.Invoke(null, new DisabledChangedArgs(disabled));
         // We are not using TaskExecutor to dispatch this event because the
         // event handler, if any, was not provided by the application - it is
         // always our own internal logic in the LaunchDarkly.InternalSdk
         // events code, which doesn't do anything time-consuming. So we are
         // not calling out to unknown code and it's safe to be synchronous.
     }
 }
Exemple #3
0
        protected void TriggerDisabledChange(bool propagateToBindings = true)
        {
            // check a bound bindable hasn't changed the value again (it will fire its own event)
            bool beforePropagation = disabled;

            if (propagateToBindings)
            {
                Bindings?.ForEachAlive(b => b.Disabled = disabled);
            }
            if (Equals(beforePropagation, disabled))
            {
                DisabledChanged?.Invoke(disabled);
            }
        }
        protected void TriggerDisabledChange()
        {
            DisabledChanged?.Invoke(disabled);

            foreach (var w in bindings.ToArray())
            {
                Bindable <T> b;
                if (w.TryGetTarget(out b))
                {
                    b.Disabled = disabled;
                }
                else
                {
                    bindings.Remove(w);
                }
            }
        }
Exemple #5
0
 protected virtual void OnDisabledChanged()
 {
     DisabledChanged?.Invoke(this, EventArgs.Empty);
 }
Exemple #6
0
 protected void TriggerDisabledChange()
 {
     DisabledChanged?.Invoke(disabled);
     bindings?.ForEachAlive(b => b.Disabled = disabled);
 }