예제 #1
0
 //装饰
 public void setValue(NewInfomation data)
 {
     styleInfo = data;
     myInfo    = null;
     myCurtain = null;
     //Debug.Log((myInfo == null) + "222222222222222222222");
 }
예제 #2
0
    public static List <NewInfomation> ReadInfo(string fileInfo)
    {
        List <NewInfomation> LoadList = new List <NewInfomation>();

        System.IO.StringReader stringReader = new System.IO.StringReader(fileInfo);
        //stringReader.Read(); // 跳过 BOM
        System.Xml.XmlReader reader = System.Xml.XmlReader.Create(stringReader);
        XmlDocument          myXML  = new XmlDocument();

        myXML.LoadXml(stringReader.ReadToEnd());
        XmlElement Xmlroot = myXML.DocumentElement;

        if (MsgCenter._instance.StyleTarget == TargetStyle.chuanghu)
        {
            foreach (XmlNode item in Xmlroot["prod_list"].ChildNodes)
            {
                NewInfomation newExcel = new NewInfomation();

                if (item.Attributes["prod_pic_url"] != null)
                {
                    newExcel.URL = item.Attributes["prod_pic_url"].Value;
                }
                if (item.Attributes["prod_spic_url"] != null)
                {
                    newExcel.Icon = item.Attributes["prod_spic_url"].Value;
                }
                if (item.Attributes["prod_name"] != null)
                {
                    newExcel.Name = item.Attributes["prod_name"].Value;
                }
                if (item.Attributes["measure_l"] != null)
                {
                    newExcel.L = item.Attributes["measure_l"].Value;
                }
                if (item.Attributes["measure_w"] != null)
                {
                    newExcel.W = item.Attributes["measure_w"].Value;
                }
                if (item.Attributes["measure_h"] != null)
                {
                    newExcel.H = item.Attributes["measure_h"].Value;
                }
                //newExcel.description = item["Description"].InnerText;
                LoadList.Add(newExcel);
            }
        }
        else
        {
            foreach (XmlNode item in Xmlroot["panorama_list"].ChildNodes)
            {
                NewInfomation newExcel = new NewInfomation();

                if (item.Attributes["panorama_file_url"] != null)
                {
                    newExcel.URL = item.Attributes["panorama_file_url"].Value;
                }
                if (item.Attributes["panorama_spic_url"] != null)
                {
                    newExcel.Icon = item.Attributes["panorama_spic_url"].Value;
                }
                newExcel.Name = item.Attributes["panorama_name"].Value;
                //newExcel.description = item["Description"].InnerText;
                LoadList.Add(newExcel);
            }
        }
        return(LoadList);
    }