Ejemplo n.º 1
0
        static object MakeTypedLst(Lst <object> input, Type type)
        {
            var list = GenericList(type);

            input.Iter(x => list.Add(x));
            var args   = new[] { list };
            var result = typeof(List).GetRuntimeMethods()
                         .Where(m => m.Name == "createRange")
                         .Head()
                         .MakeGenericMethod(type)
                         .Invoke(null, args);

            return(result);
        }
Ejemplo n.º 2
0
        public void UpdateDependencies()
        {
            _nodes.Iter(n => n.ClearDependencies());

            var tuples =
                from source in _nodes
                from target in _nodes
                where source.Instance != target.Instance
                where source.Provides.Any(target.Requires.Contains)
                select(source, target);

            tuples.Iter(t => t.target.AddDependency(t.source));

            _nodes = Sort().Reverse();

            _dirty = false;
        }
Ejemplo n.º 3
0
        public bool Remove(DependencyNode item)
        {
            var count = _nodes.Count;

            _nodes = _nodes.Remove(item);

            var removed = count != _nodes.Count;

            if (removed)
            {
                _nodes.Iter(n => n.Dependencies.Remove(item));
            }

            _dirty |= removed;

            return(removed);
        }