private void SetMarginBottom(OpenXmlElement parent)
        {
            Paragraph para = parent.AppendChild(new Paragraph());

            para.ParagraphProperties = new ParagraphProperties();

            DocxMargin.SetBottomMargin(defaultDLMargin, para.ParagraphProperties);
        }
        private void SetDDProperties(DocxNode node)
        {
            DocxMargin margin = new DocxMargin(node);

            string leftMargin = margin.GetLeftMargin();

            if (string.IsNullOrEmpty(leftMargin))
            {
                //Default left margin of dd element
                margin.SetLeftMargin(defaultDDLeftMargin);
            }
        }
        private void SetDDProperties(DocxNode node)
        {
            DocxMargin margin = new DocxMargin(node);

            string leftMargin = margin.GetLeftMargin();

            if (string.IsNullOrEmpty(leftMargin))
            {
                //Default left margin of dd element
                margin.SetLeftMargin(defaultDDLeftMargin);
            }
        }
        internal void Process(Paragraph element, DocxNode node)
        {
            ParagraphProperties properties = element.ParagraphProperties;

            if (properties == null)
            {
                properties = new ParagraphProperties();
            }

            //Order of assigning styles to paragraph property is important. The order should not change.
            ProcessBorder(node, properties);

            string backgroundColor = node.ExtractStyleValue(DocxColor.backGroundColor);
            string backGround      = DocxColor.ExtractBackGround(node.ExtractStyleValue(DocxColor.backGround));

            if (!string.IsNullOrEmpty(backgroundColor))
            {
                DocxColor.ApplyBackGroundColor(backgroundColor, properties);
            }
            else if (!string.IsNullOrEmpty(backGround))
            {
                DocxColor.ApplyBackGroundColor(backGround, properties);
            }

            DocxMargin margin = new DocxMargin(node);

            margin.ProcessParagraphMargin(properties);

            string textAlign = node.ExtractStyleValue(DocxAlignment.textAlign);

            if (!string.IsNullOrEmpty(textAlign))
            {
                DocxAlignment.ApplyTextAlign(textAlign, properties);
            }

            if (element.ParagraphProperties == null && properties.HasChildren)
            {
                element.ParagraphProperties = properties;
            }
        }
        internal void Process(Paragraph element, DocxNode node)
		{
			ParagraphProperties properties = element.ParagraphProperties;
			
			if (properties == null)
			{
				properties = new ParagraphProperties();
			}
			
			//Order of assigning styles to paragraph property is important. The order should not change.
            ProcessBorder(node, properties);

            string backgroundColor = node.ExtractStyleValue(DocxColor.backGroundColor);
            string backGround = DocxColor.ExtractBackGround(node.ExtractStyleValue(DocxColor.backGround));

			if (!string.IsNullOrEmpty(backgroundColor))
			{
				DocxColor.ApplyBackGroundColor(backgroundColor, properties);
			}
			else if(!string.IsNullOrEmpty(backGround))
            {
                DocxColor.ApplyBackGroundColor(backGround, properties);
            }

            DocxMargin margin = new DocxMargin(node);
			margin.ProcessParagraphMargin(properties);

            string textAlign = node.ExtractStyleValue(DocxAlignment.textAlign);
			if (!string.IsNullOrEmpty(textAlign))
			{
				DocxAlignment.ApplyTextAlign(textAlign, properties);
			}
			
			if (element.ParagraphProperties == null && properties.HasChildren)
			{
				element.ParagraphProperties = properties;
			}
		}