/// <summary>
        /// Gets the neededed dependencies of the package.
        /// </summary>
        /// <param name="package">The package.</param>
        /// <returns>a list of needed package dependencies</returns>
        private static DependingPackageList NeededDependencies(Package package)
        {
            ProgressInfo.Info = Resources.stateListElem;
            DependingPackageList dpList     = new DependingPackageList();
            List <Connector>     connectors = Manipulation.GetAllElementConnectors(package);

            List <Element> elements = Manipulation.GetAllElements(package);

            ProgressInfo.Reset(Resources.stateSearchNewDep, 0, elements.Count);

            foreach (Element element in elements)
            {
                ProgressInfo.Next();


                foreach (Method method in element.Methods)
                {
                    if (method.ClassifierID != "0")
                    {
                        Package clientPackage   = Manipulation.GetElementPackage(pRepository, element.ElementID);
                        Package supplierPackage = Manipulation.GetElementPackage(
                            pRepository,
                            pRepository.GetElementByID(Convert.ToInt32(method.ClassifierID))
                            .ElementID);

                        if ((supplierPackage != null) && (clientPackage != null))
                        {
                            if (clientPackage.Element.ElementID != supplierPackage.Element.ElementID)
                            {
                                if (!dpList.IsInList(supplierPackage.Element.ElementID, clientPackage.Element.ElementID))
                                {
                                    dpList.AddNew(supplierPackage.Element, clientPackage.Element, "Source -> Destination");
                                }
                            }
                        }
                    }
                    foreach (Parameter theParameter in method.Parameters)
                    {
                        if (theParameter.ClassifierID != "0")
                        {
                            Package clientPackage   = Manipulation.GetElementPackage(pRepository, element.ElementID);
                            Package supplierPackage = Manipulation.GetElementPackage(
                                pRepository,
                                pRepository.GetElementByID(Convert.ToInt32(theParameter.ClassifierID))
                                .ElementID);
                            if ((supplierPackage != null) && (clientPackage != null))
                            {
                                if (clientPackage.Element.ElementID != supplierPackage.Element.ElementID)
                                {
                                    if (!dpList.IsInList(supplierPackage.Element.ElementID, clientPackage.Element.ElementID))
                                    {
                                        dpList.AddNew(supplierPackage.Element, clientPackage.Element, "Source -> Destination");
                                    }
                                }
                            }
                        }
                    }
                }

                foreach (EA.Attribute attribute in element.Attributes)
                {
                    if (attribute.ClassifierID != 0)
                    {
                        Package clientPackage   = Manipulation.GetElementPackage(pRepository, element.ElementID);
                        Package supplierPackage = Manipulation.GetElementPackage(
                            pRepository,
                            pRepository.GetElementByID(attribute.ClassifierID).ElementID);


                        if ((supplierPackage != null) && (clientPackage != null))
                        {
                            if (clientPackage.Element.ElementID != supplierPackage.Element.ElementID)
                            {
                                if (!dpList.IsInList(supplierPackage.Element.ElementID, clientPackage.Element.ElementID))
                                {
                                    dpList.AddNew(supplierPackage.Element, clientPackage.Element, "Source -> Destination");
                                }
                            }
                        }
                    }
                }
            }

            ProgressInfo.Reset(Resources.stateSearchNewDep, 0, connectors.Count);

            foreach (Connector connector in connectors)
            {
                ProgressInfo.Next();
                Package clientPackage   = Manipulation.GetElementPackage(pRepository, connector.ClientID);
                Package supplierPackage = Manipulation.GetElementPackage(pRepository, connector.SupplierID);

                if ((supplierPackage != null) && (clientPackage != null))
                {
                    if (clientPackage.Element.ElementID != supplierPackage.Element.ElementID)
                    {
                        if (!dpList.IsInList(supplierPackage.Element.ElementID, clientPackage.Element.ElementID))
                        {
                            dpList.AddNew(supplierPackage.Element, clientPackage.Element, connector.Direction);
                        }
                    }
                }
            }



            ProgressInfo.Reset();
            return(dpList);
        }