Beispiel #1
0
        private void AppendCurrentPath(ParameterCollection parameterCollection)
        {
            ParameterCollection.ValueChangedDelegate currentDelegate;
            
            // Check if this container is already used at some point in the path (cyclic ref)
            var key = path.Keys[containers.Count];
            var keyAndContainer = new KeyValuePair<ParameterKey, ParameterCollection>(key, parameterCollection);
            var containerIndex = containers.IndexOf(keyAndContainer);

            if (containerIndex == -1)
            {
                var pathIndex = containers.Count;
                currentDelegate = (internalValueKey, internalValue, oldValue) =>
                    propertyContainer_PropertyUpdated(parameterCollection, internalValue.Object, oldValue, pathIndex);
                parameterCollection.AddEvent(key, currentDelegate);
            }
            else
            {
                currentDelegate = delegates[containerIndex];
            }

            containers.Add(keyAndContainer);
            delegates.Add(currentDelegate);
        }
Beispiel #2
0
        private void AppendCurrentPath(ParameterCollection parameterCollection)
        {
            ParameterCollection.ValueChangedDelegate currentDelegate;

            // Check if this container is already used at some point in the path (cyclic ref)
            var key             = path.Keys[containers.Count];
            var keyAndContainer = new KeyValuePair <ParameterKey, ParameterCollection>(key, parameterCollection);
            var containerIndex  = containers.IndexOf(keyAndContainer);

            if (containerIndex == -1)
            {
                var pathIndex = containers.Count;
                currentDelegate = (internalValueKey, internalValue, oldValue) =>
                                  propertyContainer_PropertyUpdated(parameterCollection, internalValue.Object, oldValue, pathIndex);
                parameterCollection.AddEvent(key, currentDelegate);
            }
            else
            {
                currentDelegate = delegates[containerIndex];
            }

            containers.Add(keyAndContainer);
            delegates.Add(currentDelegate);
        }