Exemplo n.º 1
0
        public void CommitChanges()
        {
            if (!IsDirty)
            {
                return;
            }
            XmlNodeList nodes;
            XmlNode     node;

            node = _itemNode.Attributes["Include"];
            if (node == null)
            {
                throw new InvalidOperationException("No Include attribute found.");
            }
            node.Value = Include;

            nodes = _itemNode.SelectNodes("root:HintPath", _nsmgr);
            if (nodes != null)
            {
                foreach (XmlNode node2 in nodes)
                {
                    _itemNode.RemoveChild(node2);
                }
            }

            nodes = _itemNode.SelectNodes("root:SpecificVersion", _nsmgr);
            if (nodes != null)
            {
                foreach (XmlNode node2 in nodes)
                {
                    _itemNode.RemoveChild(node2);
                }
            }

            nodes = _itemNode.SelectNodes("root:Private", _nsmgr);
            if (nodes != null)
            {
                foreach (XmlNode node2 in nodes)
                {
                    _itemNode.RemoveChild(node2);
                }
            }

            if (HasHintPath)
            {
                node           = _itemNode.OwnerDocument.CreateElement("HintPath", _nsmgr.LookupNamespace("root"));
                node.InnerText = HintPath;
                _itemNode.AppendChild(node);
            }
            if (!SpecificVersion)
            {
                node           = _itemNode.OwnerDocument.CreateElement("SpecificVersion", _nsmgr.LookupNamespace("root"));
                node.InnerText = SpecificVersion.ToString().ToLower();
                _itemNode.AppendChild(node);
            }
            if (!Private)
            {
                node           = _itemNode.OwnerDocument.CreateElement("Private", _nsmgr.LookupNamespace("root"));
                node.InnerText = Private.ToString().ToLower();
                _itemNode.AppendChild(node);
            }

            IsDirty = false;
        }
Exemplo n.º 2
0
 public static void WriteSynqInfoFile(IAbsoluteDirectoryPath dest, SpecificVersion version)
 => WriteSynqInfoFile(dest, version.ToString());