Novacode.Table.GetOrCreate_tblPr C# (CSharp) Method

GetOrCreate_tblPr() private method

If the tblPr element doesent exist it is created, either way it is returned by this function.
private GetOrCreate_tblPr ( ) : System.Xml.Linq.XElement
return System.Xml.Linq.XElement
        internal XElement GetOrCreate_tblPr()
        {
            // Get the element.
            XElement tblPr = Xml.Element(XName.Get("tblPr", DocX.w.NamespaceName));

            // If it dosen't exist, create it.
            if (tblPr == null)
            {
                Xml.AddFirst(new XElement(XName.Get("tblPr", DocX.w.NamespaceName)));
                tblPr = Xml.Element(XName.Get("tblPr", DocX.w.NamespaceName));
            }

            // Return the pPr element for this Paragraph.
            return tblPr;
        }