예제 #1
0
 protected void TriggerDisabledChange(bool propagateToBindings = true)
 {
     DisabledChanged?.Invoke(disabled);
     if (propagateToBindings)
     {
         bindings?.ForEachAlive(b => b.Disabled = disabled);
     }
 }
예제 #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.
     }
 }
예제 #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);
            }
        }
예제 #4
0
        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);
                }
            }
        }
예제 #5
0
 protected virtual void OnDisabledChanged()
 {
     DisabledChanged?.Invoke(this, EventArgs.Empty);
 }
예제 #6
0
 protected void TriggerDisabledChange()
 {
     DisabledChanged?.Invoke(disabled);
     bindings?.ForEachAlive(b => b.Disabled = disabled);
 }