internal override void removeFromUpstreamComputings(IComputingInternal computing)        
 {
     (_source as IComputingInternal)?.RemoveDownstreamConsumedComputing(computing);
     (_sourceScalar as IComputingInternal)?.RemoveDownstreamConsumedComputing(computing);
     (_sortDirectionScalar as IComputingInternal)?.RemoveDownstreamConsumedComputing(computing);
     (_comparerScalar as IComputingInternal)?.RemoveDownstreamConsumedComputing(computing);
 }
 protected override void initialize()
 {
     Utils.initializeSourceScalar(_sourceScalar, ref _source, scalarValueChangedHandler);
     _initialized = true;
     processSourceUpstreamComputings(_addToUpstreamComputing, true);
     _addToUpstreamComputing = null;
 }
Beispiel #3
0
        private ConstantExpression getConstantExpression(Expression node)
        {
            ConstantExpression getConstantExpressionLocal()
            {
                IComputingInternal nestedComputing = (IComputingInternal)Expression.Lambda(node).Compile().DynamicInvoke();

                NestedComputings.Add(nestedComputing);
                return(Expression.Constant(nestedComputing, node.Type));
            }

            if (_parameterExpressions != null)
            {
                ParametersFinder parametersFinder = new ParametersFinder(_parameterExpressions);
                parametersFinder.Visit(node);

                if (!parametersFinder.ParametersFound)
                {
                    return(getConstantExpressionLocal());
                }
                else
                {
                    ContainsParametrizedObservableComputationCalls = parametersFinder.ParametersFound;
                }
            }
            else
            {
                return(getConstantExpressionLocal());
            }

            return(null);
        }
 internal override void addToUpstreamComputings(IComputingInternal computing)
 {
     (_source as IComputingInternal)?.AddDownstreamConsumedComputing(computing);
     (_sourceScalar as IComputingInternal)?.AddDownstreamConsumedComputing(computing);
     (_sortDirectionScalar as IComputingInternal)?.AddDownstreamConsumedComputing(computing);
     (_comparerScalar as IComputingInternal)?.AddDownstreamConsumedComputing(computing);
 }
 internal override void addToUpstreamComputings(IComputingInternal computing)
 {
     Utils.AddDownstreamConsumedComputing(computing, _sourceScalar, _source);
     if (_initialized)
     {
         processSourceUpstreamComputings(computing, true);
     }
     else
     {
         _addToUpstreamComputing = computing;
     }
 }
Beispiel #6
0
        public void Dispose()
        {
            int computingsCount = _computings.Count;

            for (var index = computingsCount - 1; index >= 0; index--)
            {
                IComputingInternal computing = _computings[index];
                computing.RemoveConsumer(this);
            }

            _computings = new List <IComputingInternal>();
        }
Beispiel #7
0
        internal override void removeFromUpstreamComputings(IComputingInternal computing)
        {
            void perform() => Utils.RemoveDownstreamConsumedComputing(computing, _sourceScalar, _source);

            if (_sourceOcDispatcher != null)
            {
                _sourceOcDispatcher.Invoke(
                    perform,
                    _sourceOcDispatcherPriority,
                    _sourceOcDispatcherParameter,
                    this);
            }
            else
            {
                perform();
            }
        }
 private void processSourceUpstreamComputings(IComputingInternal computing, bool addOrRemove)
 {
     IList sourceAsList = _sources as IList;
     if (sourceAsList != null)
     {
         int count = sourceAsList.Count;
         for (int sourceIndex = 0; sourceIndex < count; sourceIndex++)
         {
             IReadScalar<IComputingInternal> sourceScalar = sourceAsList[sourceIndex] as IReadScalar<IComputingInternal>;
             IComputingInternal computingInternal =
                 sourceScalar != null ? sourceScalar.Value : (sourceAsList[sourceIndex] as IComputingInternal);
             
             if (addOrRemove)
                 computingInternal?.AddDownstreamConsumedComputing(computing);
             else
                 computingInternal?.RemoveDownstreamConsumedComputing(computing);
         }
     }
 }
        private void processSourceUpstreamComputings(IComputingInternal computing, bool addOrRemove)
        {
            if (_source is IList sourceAsList)
            {
                int count = sourceAsList.Count;
                for (int sourceIndex = 0; sourceIndex < count; sourceIndex++)
                {
                    IComputingInternal computingInternal = sourceAsList[sourceIndex] as IComputingInternal;

                    if (addOrRemove)
                    {
                        computingInternal?.AddDownstreamConsumedComputing(computing);
                    }
                    else
                    {
                        computingInternal?.RemoveDownstreamConsumedComputing(computing);
                    }
                }
            }
        }
 internal override void removeFromUpstreamComputings(IComputingInternal computing)
 {
     base.removeFromUpstreamComputings(computing);
     (_argument as IComputingInternal)?.RemoveDownstreamConsumedComputing(computing);
 }
 internal override void addToUpstreamComputings(IComputingInternal computing)
 {
     base.addToUpstreamComputings(computing);
     (_argument as IComputingInternal)?.AddDownstreamConsumedComputing(computing);
 }
Beispiel #12
0
 internal override void addToUpstreamComputings(IComputingInternal computing)
 {
     (_source as IComputingInternal)?.AddDownstreamConsumedComputing(computing);
     (_sourceScalar as IComputingInternal)?.AddDownstreamConsumedComputing(computing);
     Utils.AddDownstreamConsumedComputing(_itemInfos, this);
 }
Beispiel #13
0
 internal override void removeFromUpstreamComputings(IComputingInternal computing)
 {
     (_source as IComputingInternal)?.RemoveDownstreamConsumedComputing(computing);
     (_sourceScalar as IComputingInternal)?.RemoveDownstreamConsumedComputing(computing);
     Utils.RemoveDownstreamConsumedComputing(_itemInfos, this);
 }
 internal override void removeFromUpstreamComputings(IComputingInternal computing)
 {
     invokeSourceDispatcher(() =>
                            Utils.unsubscribeSourceScalar(_sourceScalar, handleSourceScalarValueChanged));
 }
Beispiel #15
0
 internal override void addToUpstreamComputings(IComputingInternal computing)
 {
 }
Beispiel #16
0
 internal override void removeFromUpstreamComputings(IComputingInternal computing)
 {
     Utils.RemoveDownstreamConsumedComputing(computing, _sourceScalar, _source);
 }
Beispiel #17
0
 internal void AddComputing(IComputingInternal computing)
 {
     _computings.Add(computing);
 }
 internal override void removeFromUpstreamComputings(IComputingInternal computing)        
 {
     (_sources as IComputingInternal)?.RemoveDownstreamConsumedComputing(computing);
     (_sourcesScalar as IComputingInternal)?.RemoveDownstreamConsumedComputing(computing);
     processSourceUpstreamComputings(computing, false);
 }
 internal override void addToUpstreamComputings(IComputingInternal computing)
 {
     (_sources as IComputingInternal)?.AddDownstreamConsumedComputing(computing);
     (_sourcesScalar as IComputingInternal)?.AddDownstreamConsumedComputing(computing);
     processSourceUpstreamComputings(computing, true);
 }
Beispiel #20
0
 internal override void removeFromUpstreamComputings(IComputingInternal computing)
 {
 }
Beispiel #21
0
 internal override void addToUpstreamComputings(IComputingInternal computing)
 {
     Utils.AddDownstreamConsumedComputing(computing, _sourceScalar, _source);
 }
Beispiel #22
0
 internal override void removeFromUpstreamComputings(IComputingInternal computing)
 {
     (_source as IComputingInternal)?.RemoveDownstreamConsumedComputing(computing);
 }
Beispiel #23
0
 internal override void addToUpstreamComputings(IComputingInternal computing)
 {
     (_sourceScalar as IComputingInternal)?.AddDownstreamConsumedComputing(computing);
 }
 internal override void addToUpstreamComputings(IComputingInternal computing)
 {
     invokeSourceDispatcher(() =>
                            Utils.AddDownstreamConsumedComputing(computing, _sourceScalar, _source));
 }