예제 #1
0
 public XElement ParseXElement()
 {
     dummyVar0       = XNamespace.op_Implicit("http://www.w3.org/1999/xhtml");
     V_0             = XNamespace.op_Implicit("http://www.sitemaps.org/schemas/sitemap/0.9");
     V_1             = XNamespace.op_Implicit("http://www.w3.org/1999/xhtml");
     V_2             = new XElement(XNamespace.op_Addition(V_0, "url"));
     stackVariable10 = V_2;
     stackVariable13 = XNamespace.op_Addition(V_0, "lastmod");
     if (this.get_LastMod().get_HasValue())
     {
         stackVariable21 = this.get_LastMod().get_Value();
     }
     else
     {
         stackVariable21 = DateTime.get_UtcNow();
     }
     stackVariable10.Add(new XElement(stackVariable13, (object)stackVariable21));
     V_2.Add(new XElement(XNamespace.op_Addition(V_0, "changefreq"), this.get_ChangeFreq()));
     V_2.Add(new XElement(XNamespace.op_Addition(V_0, "priority"), (object)this.get_Priority()));
     V_2.Add(new XElement(XNamespace.op_Addition(V_0, "loc"), this.get_Loc()));
     V_4 = this.get_OtherLanguages().GetEnumerator();
     try
     {
         while (V_4.MoveNext())
         {
             V_5                = V_4.get_Current();
             stackVariable56    = XNamespace.op_Addition(V_1, "link");
             stackVariable58    = new object[4];
             stackVariable58[0] = new XAttribute(XNamespace.op_Addition(XNamespace.get_Xmlns(), "xhtml"), V_1.get_NamespaceName());
             stackVariable58[1] = new XAttribute(XName.op_Implicit("rel"), "alternate");
             stackVariable58[2] = new XAttribute(XName.op_Implicit("hreflang"), V_5.get_HrefLang());
             stackVariable58[3] = new XAttribute(XName.op_Implicit("href"), V_5.get_Href());
             V_2.Add(new XElement(stackVariable56, stackVariable58));
         }
     }
     finally
     {
         ((IDisposable)V_4).Dispose();
     }
     return(V_2);
 }
예제 #2
0
        public MobileComponent(XElement element)
        {
            base();
            if (element != null)
            {
                stackVariable6 = element.Attribute(XName.op_Implicit("class"));
                if (stackVariable6 != null)
                {
                    stackVariable7 = stackVariable6.get_Value();
                }
                else
                {
                    dummyVar0      = stackVariable6;
                    stackVariable7 = null;
                }
                this.set_StyleName(stackVariable7);
                this.set_DataSource(new List <MobileComponent>());
                V_0 = element.Elements();
                if (!V_0.Any <XElement>())
                {
                    V_4 = element.get_Name().get_LocalName();
                    if (V_4 != null)
                    {
                        if (string.op_Equality(V_4, "img"))
                        {
                            this.set_ComponentType("Image");
                            this.set_DataType("image_url");
                            stackVariable57 = element.Attribute(XName.op_Implicit("src"));
                            if (stackVariable57 != null)
                            {
                                stackVariable67 = stackVariable57.get_Value().Replace("Model.", "@Model.").Replace("{{", "").Replace("}}", "");
                            }
                            else
                            {
                                dummyVar2       = stackVariable57;
                                stackVariable67 = null;
                            }
                            this.set_DataValue(stackVariable67);
                            return;
                        }
                        if (string.op_Equality(V_4, "br"))
                        {
                            goto Label0;
                        }
                    }
                    this.set_ComponentType("Text");
                    V_3 = element.get_Value().Trim();
                    if (!V_3.Contains("{{") || !V_3.Contains("}}"))
                    {
                        this.set_DataType("string");
                    }
                    else
                    {
                        this.set_DataType("object");
                    }
                    this.set_DataValue(element.get_Value().Trim().Replace("Model.", "@Model.").Replace("{{", "").Replace("}}", ""));
                }
                else
                {
                    if (element.Attribute(XName.op_Implicit("data")) == null)
                    {
                        this.set_ComponentType("View");
                        this.set_DataType("component");
                    }
                    else
                    {
                        this.set_ComponentType("View");
                        stackVariable100 = element.Attribute(XName.op_Implicit("data"));
                        if (stackVariable100 != null)
                        {
                            stackVariable110 = stackVariable100.get_Value().Replace("Model.", "@Model.").Replace("{{", "").Replace("}}", "");
                        }
                        else
                        {
                            dummyVar1        = stackVariable100;
                            stackVariable110 = null;
                        }
                        this.set_DataValue(stackVariable110);
                        this.set_DataType("object_array");
                    }
                    V_1 = V_0.GetEnumerator();
                    try
                    {
                        while (V_1.MoveNext())
                        {
                            V_2 = V_1.get_Current();
                            if (!XName.op_Inequality(V_2.get_Name(), XName.op_Implicit("br")))
                            {
                                continue;
                            }
                            this.get_DataSource().Add(new MobileComponent(V_2));
                        }
                    }
                    finally
                    {
                        if (V_1 != null)
                        {
                            V_1.Dispose();
                        }
                    }
                }
            }
Label0:
            return;
        }