/// <summary>
 /// Default constructor
 /// </summary>
 public TemplateCollection()
 {
     this.templates          = new Templates();
     this.styleResources     = new StylesCollection();
     this.maps               = new MapCollection();
     this.cellStyleSelectors = new CellStyleSelectorCollection();
 }
Exemple #2
0
        /// <summary>
        /// Ctor. Creates in instance of a <see cref="ExcelStylesManager"/> which is used to map<br/>
        /// <see cref="ExcelCellInfo">information about a cell that is to be written to Excel</see><br/>
        /// to Excel <see cref="Stylesheet"/> styles (keyed using uint)
        /// </summary>
        /// <param name="document">OpenXML workbook</param>
        public ExcelStylesManager(SpreadsheetDocument document)
        {
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }

            // Load shared map styles which are stored as a local resource
            this.sharedMapStyles  = StylesCollection.Deserialize(Properties.Resources.SharedMapStyles);
            this.currentMapStyles = new StylesCollection();

            this.stylesheet = document.WorkbookPart.GetPartsOfType <WorkbookStylesPart>().First().Stylesheet;

            this.styles        = new StylesDictionary();
            this.fills         = new FillsDictionary();
            this.fonts         = new FontsDictionary();
            this.numberFormats = new NumberFormatsDictionary();
            this.borders       = new BordersDictionary();
        }