Exemplo n.º 1
0
        XElement EnsureRoot(Persistence.IXMLStorageSection sect)
        {
            XElement root = sect.Data.Element(RootNodeName);

            if (root == null)
            {
                sect.Data.Add(root = new XElement(RootNodeName));
            }
            return(root);
        }
Exemplo n.º 2
0
        private bool IsOutputOutdated(ILogSource logSource, Persistence.IXMLStorageSection outputSection)
        {
            var logSourceEtag = logSource.Provider.Stats.ContentsEtag;

            if (logSourceEtag != null)
            {
                var etagAttr = outputSection.Data.Root.Attribute(XName.Get("etag", xmlNs));
                if (etagAttr != null)
                {
                    if (logSourceEtag.Value.ToString() != etagAttr.Value)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }