Example #1
0
 internal int AddFormat(string format)
 {
     if (format == null || format.Length == 0)
     {
         return(0);
     }
     if (!m_formatStringMap.TryGetValue(format, out int value))
     {
         value = m_currentCustomFormatIndex;
         BIFF8Format item = new BIFF8Format(format, value);
         m_formatStringMap.Add(format, value);
         m_formatIntMap.Add(value, m_formats.Count);
         m_formats.Add(item);
         m_currentCustomFormatIndex++;
     }
     return(value);
 }
Example #2
0
        private void AddBuiltInFormats()
        {
            BIFF8Format item = new BIFF8Format("General", 0);

            m_formats.Add(item);
            m_formatIntMap.Add(item.Index, 0);
            m_formatStringMap.Add(item.String, item.Index);
            m_formats.Add(new BIFF8Format("0", 1));
            m_formats.Add(new BIFF8Format("0.00", 2));
            m_formats.Add(new BIFF8Format("#,##0", 3));
            m_formats.Add(new BIFF8Format("#,##0.00", 4));
            m_formats.Add(new BIFF8Format("\"$\"#,##0_);\\(\"$\"#,##0\\)", 5));
            m_formats.Add(new BIFF8Format("\"$\"#,##0_);[Red]\\(\"$\"#,##0\\)", 6));
            m_formats.Add(new BIFF8Format("\"$\"#,##0.00_);\\(\"$\"#,##0.00\\)", 7));
            m_formats.Add(new BIFF8Format("\"$\"#,##0.00_);[Red]\\(\"$\"#,##0.00\\)", 8));
            m_formats.Add(new BIFF8Format("0%", 9));
            m_formats.Add(new BIFF8Format("0.00E+00", 11));
            m_formats.Add(new BIFF8Format("#?/?", 12));
            m_formats.Add(new BIFF8Format("#??/??", 13));
            m_formats.Add(new BIFF8Format("M/D/YY", 14));
            m_formats.Add(new BIFF8Format("D-MMM-YY", 15));
            m_formats.Add(new BIFF8Format("D-MMM", 16));
            m_formats.Add(new BIFF8Format("MMM-YY", 17));
            m_formats.Add(new BIFF8Format("h:mm AM/PM", 18));
            m_formats.Add(new BIFF8Format("h:mm:ss AM/PM", 19));
            m_formats.Add(new BIFF8Format("h:mm", 20));
            m_formats.Add(new BIFF8Format("h:mm:ss", 21));
            m_formats.Add(new BIFF8Format("M/D/YYYY h:mm", 22));
            m_formats.Add(new BIFF8Format("(#,##0_);(#,##0)", 37));
            m_formats.Add(new BIFF8Format("(#,##0_);[Red](#,##0)", 38));
            m_formats.Add(new BIFF8Format("(#,##0.00_);(#,##0.00)", 39));
            m_formats.Add(new BIFF8Format("(#,##0.00_);[Red](#,##0.00)", 40));
            m_formats.Add(new BIFF8Format("_(* #,##0_);_(* \\(#,##0\\);_(* \"-\"_);_(@_)", 41));
            m_formats.Add(new BIFF8Format("_(\"$\"* #,##0_);_(\"$\"* \\(#,##0\\);_(\"$\"* \"-\"_);_(@_)", 42));
            m_formats.Add(new BIFF8Format("_(* #,##0.00_);_(* \\(#,##0.00\\);_(* \"-\"??_);_(@_)", 43));
            m_formats.Add(new BIFF8Format("_(\"$\"* #,##0.00_);_(\"$\"* \\(#,##0.00\\);_(\"$\"* \"-\"??_);_(@_)", 44));
            m_formats.Add(new BIFF8Format("mm:ss", 45));
            m_formats.Add(new BIFF8Format("[h]:mm:ss", 46));
            m_formats.Add(new BIFF8Format("mm:ss.0", 47));
            m_formats.Add(new BIFF8Format("##0.0E+0", 48));
            m_formats.Add(new BIFF8Format("@", 49));
        }