public int AddFormat(string format) { if (format != null && format.Length != 0) { int currentCustomFormatIndex = default(int); if (!this.m_formatStringMap.TryGetValue(format, out currentCustomFormatIndex)) { currentCustomFormatIndex = this.m_currentCustomFormatIndex; BIFF8Format item = new BIFF8Format(format, currentCustomFormatIndex); this.m_formatStringMap.Add(format, currentCustomFormatIndex); this.m_formatIntMap.Add(currentCustomFormatIndex, this.m_formats.Count); this.m_formats.Add(item); this.m_currentCustomFormatIndex++; } return(currentCustomFormatIndex); } return(0); }
private void AddBuiltInFormats() { BIFF8Format item = new BIFF8Format("General", 0); this.m_formats.Add(item); this.m_formatIntMap.Add(item.Index, 0); this.m_formatStringMap.Add(item.String, item.Index); this.m_formats.Add(new BIFF8Format("0", 1)); this.m_formats.Add(new BIFF8Format("0.00", 2)); this.m_formats.Add(new BIFF8Format("#,##0", 3)); this.m_formats.Add(new BIFF8Format("#,##0.00", 4)); this.m_formats.Add(new BIFF8Format("\"$\"#,##0_);\\(\"$\"#,##0\\)", 5)); this.m_formats.Add(new BIFF8Format("\"$\"#,##0_);[Red]\\(\"$\"#,##0\\)", 6)); this.m_formats.Add(new BIFF8Format("\"$\"#,##0.00_);\\(\"$\"#,##0.00\\)", 7)); this.m_formats.Add(new BIFF8Format("\"$\"#,##0.00_);[Red]\\(\"$\"#,##0.00\\)", 8)); this.m_formats.Add(new BIFF8Format("0%", 9)); this.m_formats.Add(new BIFF8Format("0.00E+00", 11)); this.m_formats.Add(new BIFF8Format("#?/?", 12)); this.m_formats.Add(new BIFF8Format("#??/??", 13)); this.m_formats.Add(new BIFF8Format("M/D/YY", 14)); this.m_formats.Add(new BIFF8Format("D-MMM-YY", 15)); this.m_formats.Add(new BIFF8Format("D-MMM", 16)); this.m_formats.Add(new BIFF8Format("MMM-YY", 17)); this.m_formats.Add(new BIFF8Format("h:mm AM/PM", 18)); this.m_formats.Add(new BIFF8Format("h:mm:ss AM/PM", 19)); this.m_formats.Add(new BIFF8Format("h:mm", 20)); this.m_formats.Add(new BIFF8Format("h:mm:ss", 21)); this.m_formats.Add(new BIFF8Format("M/D/YYYY h:mm", 22)); this.m_formats.Add(new BIFF8Format("(#,##0_);(#,##0)", 37)); this.m_formats.Add(new BIFF8Format("(#,##0_);[Red](#,##0)", 38)); this.m_formats.Add(new BIFF8Format("(#,##0.00_);(#,##0.00)", 39)); this.m_formats.Add(new BIFF8Format("(#,##0.00_);[Red](#,##0.00)", 40)); this.m_formats.Add(new BIFF8Format("_(* #,##0_);_(* \\(#,##0\\);_(* \"-\"_);_(@_)", 41)); this.m_formats.Add(new BIFF8Format("_(\"$\"* #,##0_);_(\"$\"* \\(#,##0\\);_(\"$\"* \"-\"_);_(@_)", 42)); this.m_formats.Add(new BIFF8Format("_(* #,##0.00_);_(* \\(#,##0.00\\);_(* \"-\"??_);_(@_)", 43)); this.m_formats.Add(new BIFF8Format("_(\"$\"* #,##0.00_);_(\"$\"* \\(#,##0.00\\);_(\"$\"* \"-\"??_);_(@_)", 44)); this.m_formats.Add(new BIFF8Format("mm:ss", 45)); this.m_formats.Add(new BIFF8Format("[h]:mm:ss", 46)); this.m_formats.Add(new BIFF8Format("mm:ss.0", 47)); this.m_formats.Add(new BIFF8Format("##0.0E+0", 48)); this.m_formats.Add(new BIFF8Format("@", 49)); }