Exemplo n.º 1
0
 internal XmlStyle method_9(XmlStyle xmlStyle_0)
 {
     //<>c__DisplayClassa classa;
     //XmlStyle style = xmlStyle_0;
     //return this.list_0.Find(new Predicate<XmlStyle>(classa.<FindStyle>b__9));
     return(null);
 }
Exemplo n.º 2
0
 internal void method_1(XmlReader xmlReader_0)
 {
     foreach (XmlReaderAttributeItem item in xmlReader_0.GetAttributes())
     {
         string localName = item.LocalName;
         if (localName != null)
         {
             if (localName != "Color")
             {
                 if (!(localName == "PatternColor"))
                 {
                     if (localName == "Pattern")
                     {
                         this.Pattern = ObjectExtensions.ParseEnum <Aisino.Framework.Plugin.Core.ExcelXml.Pattern>(item.Value);
                     }
                 }
                 else
                 {
                     this.PatternColor = XmlStyle.smethod_1(item.Value);
                 }
             }
             else
             {
                 this.Color = XmlStyle.smethod_1(item.Value);
             }
         }
     }
 }
Exemplo n.º 3
0
 internal void method_2(XmlWriter xmlWriter_0)
 {
     xmlWriter_0.WriteStartElement("Font");
     xmlWriter_0.WriteAttributeString("ss", "FontName", null, this.Name);
     if (this.Size != 0)
     {
         xmlWriter_0.WriteAttributeString("ss", "Size", null, this.Size.ToString(CultureInfo.InvariantCulture));
     }
     xmlWriter_0.WriteAttributeString("ss", "Color", null, XmlStyle.smethod_0(this.Color));
     if (this.Bold)
     {
         xmlWriter_0.WriteAttributeString("ss", "Bold", null, "1");
     }
     if (this.Italic)
     {
         xmlWriter_0.WriteAttributeString("ss", "Italic", null, "1");
     }
     if (this.Underline)
     {
         xmlWriter_0.WriteAttributeString("ss", "Underline", null, "Single");
     }
     if (this.Strikeout)
     {
         xmlWriter_0.WriteAttributeString("ss", "Strikeout", null, "1");
     }
     xmlWriter_0.WriteEndElement();
 }
Exemplo n.º 4
0
 internal bool method_10(XmlStyle xmlStyle_0)
 {
     if (xmlStyle_0 == null)
     {
         return(false);
     }
     return(((this.method_0().method_0(xmlStyle_0.method_0()) && this.method_2().method_0(xmlStyle_0.method_2())) && (this.method_4().method_0(xmlStyle_0.method_4()) && this.method_6().method_0(xmlStyle_0.method_6()))) && (this.DisplayFormat == xmlStyle_0.DisplayFormat));
 }
Exemplo n.º 5
0
        internal object method_0(Delegate35 delegate35_0)
        {
            if (this.vmethod_0() == null)
            {
                return(delegate35_0(this.styles_0.vmethod_2()));
            }
            XmlStyle styles = this.vmethod_0().method_6(this.styles_0.StyleID);

            return(delegate35_0(styles));
        }
Exemplo n.º 6
0
        private void method_10(XmlReader xmlReader_0)
        {
            bool     isEmptyElement = xmlReader_0.IsEmptyElement;
            int      count          = this.list_1.Count;
            double   num2           = -1.0;
            XmlStyle style          = null;
            bool     flag2          = false;

            foreach (XmlReaderAttributeItem item in xmlReader_0.GetAttributes())
            {
                if ((item.LocalName == "Height") && item.HasValue)
                {
                    item.Value.ParseToInt <double>(out num2);
                }
                if ((item.LocalName == "Index") && item.HasValue)
                {
                    item.Value.ParseToInt <int>(out count);
                    count--;
                }
                if ((item.LocalName == "StyleID") && item.HasValue)
                {
                    style = this.excelXmlWorkbook_0.method_6(item.Value);
                }
                if ((item.LocalName == "Hidden") && item.HasValue)
                {
                    flag2 = item.Value == "1";
                }
            }
            Row row = this.method_13(count);

            row.Hidden = flag2;
            if (num2 != -1.0)
            {
                row.Height = num2;
            }
            if (style != null)
            {
                row.Style = style;
            }
            if (!isEmptyElement)
            {
                while (xmlReader_0.Read())
                {
                    if ((xmlReader_0.Name == "Row") && (xmlReader_0.NodeType == XmlNodeType.EndElement))
                    {
                        return;
                    }
                    if ((xmlReader_0.NodeType == XmlNodeType.Element) && (xmlReader_0.Name == "Cell"))
                    {
                        this.method_11(xmlReader_0, row);
                    }
                }
            }
        }
Exemplo n.º 7
0
 private void method_2(XmlWriter xmlWriter_0, string string_0)
 {
     xmlWriter_0.WriteStartElement("Border");
     xmlWriter_0.WriteAttributeString("ss", "Position", null, string_0);
     xmlWriter_0.WriteAttributeString("ss", "LineStyle", null, this.LineStyle.ToString());
     xmlWriter_0.WriteAttributeString("ss", "Weight", null, this.Weight.ToString(CultureInfo.InvariantCulture));
     if (this.Color != System.Drawing.Color.Black)
     {
         xmlWriter_0.WriteAttributeString("ss", "Color", null, XmlStyle.smethod_0(this.Color));
     }
     xmlWriter_0.WriteEndElement();
 }
Exemplo n.º 8
0
        private void method_3()
        {
            this.Properties = new DocumentProperties();
            this.list_0     = new List <XmlStyle>();
            this.list_1     = new List <Worksheet>();
            this.list_2     = new List <Class139>();
            XmlStyle item = new XmlStyle {
                ID = "Default"
            };

            item.Alignment.Vertical = VerticalAlignment.Bottom;
            this.list_0.Add(item);
        }
Exemplo n.º 9
0
 private void method_0(XmlReader xmlReader_0)
 {
     while (xmlReader_0.Read())
     {
         if ((xmlReader_0.Name == "Styles") && (xmlReader_0.NodeType == XmlNodeType.EndElement))
         {
             break;
         }
         XmlStyle item = XmlStyle.smethod_2(xmlReader_0);
         if (item != null)
         {
             this.list_0.Add(item);
         }
     }
 }
Exemplo n.º 10
0
 public XmlStyle(XmlStyle xmlStyle_0)
 {
     if (xmlStyle_0 == null)
     {
         this.method_8();
         this.method_9();
     }
     else
     {
         this.ID = "";
         this.method_1(new FontOptions(xmlStyle_0.method_0()));
         this.method_5(new InteriorOptions(xmlStyle_0.method_4()));
         this.method_3(new AlignmentOptions(xmlStyle_0.method_2()));
         this.method_7(new BorderOptions(xmlStyle_0.method_6()));
         this.DisplayFormat = xmlStyle_0.DisplayFormat;
     }
 }
Exemplo n.º 11
0
 internal void method_2(XmlWriter xmlWriter_0)
 {
     if ((this.Color != System.Drawing.Color.Empty) || (this.PatternColor != System.Drawing.Color.Empty))
     {
         xmlWriter_0.WriteStartElement("Interior");
         if (this.Color != System.Drawing.Color.Empty)
         {
             xmlWriter_0.WriteAttributeString("ss", "Color", null, XmlStyle.smethod_0(this.Color));
         }
         if (this.PatternColor != System.Drawing.Color.Empty)
         {
             xmlWriter_0.WriteAttributeString("ss", "PatternColor", null, XmlStyle.smethod_0(this.PatternColor));
         }
         xmlWriter_0.WriteAttributeString("ss", "Pattern", null, this.Pattern.ToString());
         xmlWriter_0.WriteEndElement();
     }
 }
Exemplo n.º 12
0
        internal string method_8(XmlStyle xmlStyle_0)
        {
            XmlStyle style = this.method_9(xmlStyle_0);

            if (style != null)
            {
                return(style.ID);
            }
            int count = this.list_0.Count;

            xmlStyle_0.ID = string.Format(CultureInfo.InvariantCulture, "S{0:00}", new object[] { count++ });
            while (this.method_7(xmlStyle_0.ID))
            {
                xmlStyle_0.ID = string.Format(CultureInfo.InvariantCulture, "S{0:00}", new object[] { count++ });
            }
            this.list_0.Add(xmlStyle_0);
            return(xmlStyle_0.ID);
        }
Exemplo n.º 13
0
        internal void method_1(XmlReader xmlReader_0)
        {
            foreach (XmlReaderAttributeItem item in xmlReader_0.GetAttributes())
            {
                switch (item.LocalName)
                {
                case "FontName":
                    this.Name = item.Value;
                    break;

                case "Size":
                    int num;
                    if (item.Value.ParseToInt <int>(out num))
                    {
                        this.Size = num;
                    }
                    break;

                case "Color":
                    this.Color = XmlStyle.smethod_1(item.Value);
                    break;

                case "Bold":
                    this.Bold = item.Value == "1";
                    break;

                case "Italic":
                    this.Italic = item.Value == "1";
                    break;

                case "Underline":
                    this.Underline = item.Value == "Single";
                    break;

                case "Strikeout":
                    this.Strikeout = item.Value == "1";
                    break;
                }
            }
        }
Exemplo n.º 14
0
 private void method_9(XmlReader xmlReader_0)
 {
     if (!xmlReader_0.IsEmptyElement)
     {
         int num = 0;
         while (xmlReader_0.Read())
         {
             string str;
             if ((xmlReader_0.Name == "Table") && (xmlReader_0.NodeType == XmlNodeType.EndElement))
             {
                 break;
             }
             if ((xmlReader_0.NodeType == XmlNodeType.Element) && ((str = xmlReader_0.Name) != null))
             {
                 if (!(str == "Column"))
                 {
                     if (str == "Row")
                     {
                         this.method_10(xmlReader_0);
                     }
                 }
                 else
                 {
                     double   num2  = 0.0;
                     bool     flag  = false;
                     int      num4  = 1;
                     XmlStyle style = null;
                     foreach (XmlReaderAttributeItem item in xmlReader_0.GetAttributes())
                     {
                         double num5;
                         if (((item.LocalName == "Width") && item.HasValue) && item.Value.ParseToInt <double>(out num5))
                         {
                             num2 = num5;
                         }
                         if ((item.LocalName == "Hidden") && item.HasValue)
                         {
                             flag = item.Value == "1";
                         }
                         if ((item.LocalName == "Index") && item.HasValue)
                         {
                             item.Value.ParseToInt <int>(out num);
                         }
                         if ((item.LocalName == "Span") && item.HasValue)
                         {
                             item.Value.ParseToInt <int>(out num4);
                         }
                         if ((item.LocalName == "StyleID") && item.HasValue)
                         {
                             style = this.excelXmlWorkbook_0.method_6(item.Value);
                         }
                     }
                     for (int i = 1; i <= num4; i++)
                     {
                         this.Columns(num).Width  = num2;
                         this.Columns(num).Hidden = flag;
                         if (style != null)
                         {
                             this.Columns(num).Style = style;
                         }
                         num++;
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 15
0
        private void method_11(XmlReader xmlReader_0, Row row_0)
        {
            bool     isEmptyElement = xmlReader_0.IsEmptyElement;
            int      count          = row_0.list_0.Count;
            int      num2           = 0;
            int      num3           = 0;
            XmlStyle style          = null;
            string   str            = "";
            string   str2           = "";

            foreach (XmlReaderAttributeItem item in xmlReader_0.GetAttributes())
            {
                if ((item.LocalName == "Index") && item.HasValue)
                {
                    item.Value.ParseToInt <int>(out count);
                    count--;
                }
                if ((item.LocalName == "StyleID") && item.HasValue)
                {
                    style = this.excelXmlWorkbook_0.method_6(item.Value);
                }
                if ((item.LocalName == "HRef") && item.HasValue)
                {
                    str2 = item.Value;
                }
                if ((item.LocalName == "Formula") && item.HasValue)
                {
                    str = item.Value;
                }
                if ((item.LocalName == "MergeAcross") && item.HasValue)
                {
                    item.Value.ParseToInt <int>(out num3);
                }
                if ((item.LocalName == "MergeDown") && item.HasValue)
                {
                    item.Value.ParseToInt <int>(out num2);
                }
            }
            Cell cell = this.method_12(count, row_0.int_0);

            if (style != null)
            {
                cell.Style = style;
            }
            if (!str2.IsNullOrEmpty())
            {
                cell.HRef = str2;
            }
            if (!str.IsNullOrEmpty())
            {
                Class129.smethod_3(cell, str);
            }
            else if (!isEmptyElement)
            {
                if ((num2 > 0) || (num3 > 0))
                {
                    cell.bool_0 = true;
                    Aisino.Framework.Plugin.Core.ExcelXml.Range range = new Aisino.Framework.Plugin.Core.ExcelXml.Range(cell, this.method_12(count + num3, row_0.int_0 + num2));
                    this.list_2.Add(range);
                    cell.ColumnSpan = range.ColumnCount;
                    cell.RowSpan    = range.RowCount;
                }
                while (xmlReader_0.Read())
                {
                    if ((xmlReader_0.Name == "Cell") && (xmlReader_0.NodeType == XmlNodeType.EndElement))
                    {
                        break;
                    }
                    if (xmlReader_0.NodeType == XmlNodeType.Element)
                    {
                        if (xmlReader_0.Name == "Data")
                        {
                            smethod_2(xmlReader_0, cell);
                        }
                        else if (xmlReader_0.Name == "Comment")
                        {
                            smethod_3(xmlReader_0, cell);
                        }
                    }
                }
            }
        }
Exemplo n.º 16
0
        internal static XmlStyle smethod_2(XmlReader xmlReader_0)
        {
            string   str;
            XmlStyle style          = new XmlStyle();
            bool     isEmptyElement = xmlReader_0.IsEmptyElement;
            XmlReaderAttributeItem singleAttribute = xmlReader_0.GetSingleAttribute("ID");

            if (singleAttribute != null)
            {
                style.ID = singleAttribute.Value;
            }
            if (!isEmptyElement)
            {
                goto Label_0215;
            }
            if (singleAttribute != null)
            {
                return(style);
            }
            return(null);

Label_0135:
            if (str == DateTimeFormatInfo.CurrentInfo.LongDatePattern)
            {
                style.DisplayFormat = DisplayFormatType.LongDate;
            }
            string longTimePattern = DateTimeFormatInfo.CurrentInfo.LongTimePattern;

            if (longTimePattern.Contains("t"))
            {
                longTimePattern = longTimePattern.Replace("t", "AM/PM");
            }
            if (longTimePattern.Contains("tt"))
            {
                longTimePattern = longTimePattern.Replace("tt", "AM/PM");
            }
            if (str == longTimePattern)
            {
                style.DisplayFormat = DisplayFormatType.Time;
            }
            try
            {
                style.DisplayFormat = ObjectExtensions.ParseEnum <DisplayFormatType>(str);
            }
            catch (ArgumentException)
            {
                if (str.IsNullOrEmpty())
                {
                    style.DisplayFormat = DisplayFormatType.None;
                }
                else
                {
                    style.DisplayFormat      = DisplayFormatType.Custom;
                    style.CustomFormatString = str;
                }
            }
Label_0215:
            if (xmlReader_0.Read())
            {
                string str3;
                if ((xmlReader_0.Name == "Style") && (xmlReader_0.NodeType == XmlNodeType.EndElement))
                {
                    return(style);
                }
                if ((xmlReader_0.NodeType != XmlNodeType.Element) || ((str3 = xmlReader_0.Name) == null))
                {
                    goto Label_0215;
                }
                if (str3 == "Font")
                {
                    style.method_0().method_1(xmlReader_0);
                    goto Label_0215;
                }
                if (str3 == "Alignment")
                {
                    style.method_2().method_1(xmlReader_0);
                    goto Label_0215;
                }
                if (str3 == "Interior")
                {
                    style.method_4().method_1(xmlReader_0);
                    goto Label_0215;
                }
                if (str3 == "Borders")
                {
                    style.method_6().method_1(xmlReader_0);
                    goto Label_0215;
                }
                if (!(str3 == "NumberFormat"))
                {
                    goto Label_0215;
                }
                XmlReaderAttributeItem item2 = xmlReader_0.GetSingleAttribute("Format");
                if (item2 == null)
                {
                    goto Label_0215;
                }
                str = item2.Value;
                string str4 = str;
                if (str4 != null)
                {
                    if (str4 == "Short Date")
                    {
                        style.DisplayFormat = DisplayFormatType.ShortDate;
                    }
                    else if (!(str4 == "General Date"))
                    {
                        if (!(str4 == "@"))
                        {
                            goto Label_0135;
                        }
                        style.DisplayFormat = DisplayFormatType.Text;
                    }
                    else
                    {
                        style.DisplayFormat = DisplayFormatType.GeneralDate;
                    }
                    goto Label_0215;
                }
                goto Label_0135;
            }
            return(style);
        }