Ejemplo n.º 1
0
        /// <summary>
        /// Creates a duplicate of the current value.
        /// </summary>
        /// <returns>The cloned value.</returns>
        /// <remarks>This method is a deep copy clone.</remarks>
        public object Clone()
        {
            var clone = (OpenExcelCellFormat)MemberwiseClone();

            clone.NumberingFormat = (OpenExcelNumberingFormat)NumberingFormat?.Clone();
            clone.Font            = (OpenExcelFont)Font?.Clone();
            clone.Fill            = (OpenExcelFill)Fill?.Clone();
            clone.Border          = (OpenExcelBorder)Border?.Clone();
            return(clone);
        }
Ejemplo n.º 2
0
        public static uint AddNumberingFormat(this Stylesheet stylesheet, NumberingFormat fill)
        {
            NumberingFormat clone = (NumberingFormat)fill.Clone();

            if (stylesheet.NumberingFormats == null)
            {
                stylesheet.NumberingFormats = new NumberingFormats();
            }
            stylesheet.NumberingFormats.Append(clone);
            var id = 164 + (uint)stylesheet.NumberingFormats.ToList().IndexOf(clone);

            clone.NumberFormatId = id;
            return(id);
        }