コード例 #1
0
        private int GetMaxAbstractNumId()
        {
            if (base.Document.numbering == null)
            {
                return(-1);
            }
            List <XElement> source = (from d in base.Document.numbering.Descendants()
                                      where d.Name.LocalName == "abstractNum"
                                      select d).ToList();

            if (source.Any())
            {
                return(source.Attributes(DocX.w + "abstractNumId").Max((XAttribute e) => int.Parse(e.Value)));
            }
            return(-1);
        }