Esempio n. 1
0
        /// <summary>
        ///     Adds an element as a child of this one, while updating its parent and oldparent field
        /// </summary>
        /// <param name="elem">The element in question</param>
        public void AddChild(PackageItemInternalViewModel elem)
        {
            if (elem.Parent != null)
                elem.Parent.Items.Remove(elem);

            elem.Parent = this;
            this.Items.Add(elem);
        }
Esempio n. 2
0
        /// <summary>
        ///     Adds an element as a child of this one, while updating its parent and oldparent field
        /// </summary>
        /// <param name="elem">The element in question</param>
        public void AddChild(PackageItemInternalViewModel elem)
        {
            if (elem.Parent != null)
            {
                elem.Parent.Items.Remove(elem);
            }

            elem.Parent = this;
            this.Items.Add(elem);
        }
        /// <summary>
        /// Enumerate the dependencies of this item as its children.  The
        /// </summary>
        public void BuildDependencies(HashSet <object> discoveredDeps)
        {
            this.Items.Clear();

            if (DependencyType == DependencyType.CustomNode)
            {
                foreach (var dep in Definition.DirectDependencies)
                {
                    var discovered = discoveredDeps.Contains(dep);
                    var packDep    = new PackageItemInternalViewModel(dep, this)
                    {
                        AlreadyDiscovered = discovered
                    };
                    if (!discovered)
                    {
                        discoveredDeps.Add(this);
                        packDep.BuildDependencies(discoveredDeps);
                    }
                    this.Items.Add(packDep);
                }
            }
            else if (DependencyType == DependencyType.Assembly)
            {
                foreach (var dep in Assembly.GetReferencedAssemblies())
                {
                    var depAss     = Assembly.Load(dep);
                    var discovered = discoveredDeps.Contains(dep);
                    var packDep    = new PackageItemInternalViewModel(depAss, this)
                    {
                        AlreadyDiscovered = discovered
                    };
                    if (!discovered)
                    {
                        discoveredDeps.Add(this);
                        packDep.BuildDependencies(discoveredDeps);
                    }
                    this.Items.Add(packDep);
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Enumerate the dependencies of this item as its children.  The 
        /// </summary>
        public void BuildDependencies( HashSet<object> discoveredDeps )
        {
            this.Items.Clear();

            if (DependencyType == DependencyType.CustomNode)
            {
                foreach (var dep in Definition.DirectDependencies)
                {
                    var discovered = discoveredDeps.Contains(dep);
                    var packDep = new PackageItemInternalViewModel(dep, this)
                        {
                            AlreadyDiscovered = discovered
                        };
                    if (!discovered)
                    {
                        discoveredDeps.Add(this);
                        packDep.BuildDependencies(discoveredDeps);
                    }
                    this.Items.Add(packDep);
                }
            }
            else if (DependencyType == DependencyType.Assembly)
            {
                foreach (var dep in Assembly.GetReferencedAssemblies())
                {
                    var depAss = Assembly.Load(dep);
                    var discovered = discoveredDeps.Contains(dep);
                    var packDep = new PackageItemInternalViewModel(depAss, this)
                    {
                        AlreadyDiscovered = discovered
                    };
                    if (!discovered)
                    {
                        discoveredDeps.Add(this);
                        packDep.BuildDependencies(discoveredDeps);
                    }
                    this.Items.Add(packDep);
                }
            }
        }