コード例 #1
0
        public static ViewLayoutList ReadXml(XmlReader reader)
        {
            var layoutList = new ViewLayoutList(reader.GetAttribute("viewName"))
                             .ChangeDefaultLayoutName(reader.GetAttribute("defaultLayout"));

            if (reader.IsEmptyElement)
            {
                reader.ReadElementString("layouts");
                return(layoutList);
            }
            reader.Read();
            var layouts = new List <ViewLayout>();

            while (true)
            {
                if (reader.IsStartElement("layout"))
                {
                    layouts.Add(ViewLayout.ReadXml(reader));
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    reader.ReadEndElement();
                    break;
                }
                else
                {
                    reader.Skip();
                }
            }
            layoutList = layoutList.ChangeLayouts(layouts);
            return(layoutList);
        }
コード例 #2
0
 protected bool Equals(ViewLayoutList other)
 {
     return(string.Equals(ViewName, other.ViewName) &&
            string.Equals(DefaultLayoutName, other.DefaultLayoutName) &&
            Equals(Layouts, other.Layouts));
 }