コード例 #1
0
        protected bool Equals(NuspecDependency other)
        {
            var versionsMatch = false;
            if (VersionSpec == null && other.VersionSpec == null)
            {
                versionsMatch = true;
            }
            else if (VersionSpec != null && other.VersionSpec != null)
            {
                versionsMatch = VersionSpec.ToString().Equals(other.VersionSpec.ToString());
            }

            return string.Equals(Name, other.Name) && versionsMatch;
        }
コード例 #2
0
        public void AddDependency(NuspecDependency dependency)
        {
            var dependencies = _document.XPathSelectElement("//nuspec:dependencies", _xmlNamespaceManager);

            foreach (XElement dependencyElement in dependencies.Nodes())
            {
                if (dependencyElement.Attribute("id").Value == dependency.Name)
                {
                    dependencyElement.SetAttributeValue("version", dependency.VersionSpec.ToString());
                    return;
                }
            }

            var element = new XElement(_xmlns + "dependency");

            element.SetAttributeValue("id", dependency.Name);

            if (dependency.VersionSpec != null)
            {
                element.SetAttributeValue("version", dependency.VersionSpec.ToString());
            }

            dependencies.Add(element);
        }
コード例 #3
0
        protected bool Equals(NuspecDependency other)
        {
            var versionsMatch = false;
            if (VersionSpec == null && other.VersionSpec == null)
            {
                versionsMatch = true;
            }
            else if (VersionSpec != null && other.VersionSpec != null)
            {
                versionsMatch = VersionSpec.ToString().Equals(other.VersionSpec.ToString());
            }

            return string.Equals(Name, other.Name) && versionsMatch;
        }
コード例 #4
0
ファイル: NuspecDocument.cs プロジェクト: modulexcite/ripple
        public void AddDependency(NuspecDependency dependency)
        {
            var dependencies = _document.XPathSelectElement("//nuspec:dependencies", _xmlNamespaceManager);

            foreach (XElement dependencyElement in dependencies.Nodes())
            {
                if (dependencyElement.Attribute("id").Value == dependency.Name)
                {
                    dependencyElement.SetAttributeValue("version", dependency.VersionSpec.ToString());
                    return;
                }
            }

            var element = new XElement(_xmlns + "dependency");

            element.SetAttributeValue("id", dependency.Name);

            if (dependency.VersionSpec != null)
            {
                element.SetAttributeValue("version", dependency.VersionSpec.ToString());
            }

            dependencies.Add(element);
        }