Example #1
0
        /// <summary>
        ///     Creates a new <see cref="PlaceholderLocationData" /> instance from <see cref="PlaceholderData" />.
        /// </summary>
        public PlaceholderLocationData(PlaceholderData phData)
        {
            Check.NotNull(phData, nameof(phData));

            PlaceholderType = phData.PlaceholderType;
            Index           = phData.Index;
        }
        /// <summary>
        ///     Gets placeholder data from SDK-element.
        /// </summary>
        /// <param name="sdkElement">Placeholder which is placeholder.</param>
        public PlaceholderData CreatePlaceholderData(OpenXmlElement sdkElement)
        {
            Check.NotNull(sdkElement, nameof(sdkElement));

            var result = new PlaceholderData();
            var ph     = sdkElement.Descendants <P.PlaceholderShape>().First();

            // TYPE
            result.PlaceholderType = GetPlaceholderType(ph);

            // INDEX
            if (ph.Index != null)
            {
                result.Index = (int)ph.Index.Value;
            }

            return(result);
        }