Exemple #1
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;
     }
 }
Exemple #2
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));
 }
Exemple #3
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);
        }