Read() private method

private Read ( XmlReader reader ) : void
reader System.Xml.XmlReader
return void
        internal override void Read(XmlReader reader)
        {
            base.Read(reader);
            type = (DockGroupType)Enum.Parse(typeof(DockGroupType), reader.GetAttribute("type"));
            if (type == DockGroupType.Tabbed)
            {
                string s = reader.GetAttribute("currentTabPage");
                if (s != null)
                {
                    currentTabPage = int.Parse(s);
                }
            }

            reader.MoveToElement();
            if (reader.IsEmptyElement)
            {
                reader.Skip();
                return;
            }

            reader.ReadStartElement();
            reader.MoveToContent();
            while (reader.NodeType != XmlNodeType.EndElement)
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    if (reader.LocalName == "item")
                    {
                        string   id = reader.GetAttribute("id");
                        DockItem it = Frame.GetItem(id);
                        if (it == null)
                        {
                            it = Frame.AddItem(id);
                            it.IsPositionMarker = true;
                        }
                        DockGroupItem gitem = new DockGroupItem(Frame, it);
                        gitem.Read(reader);
                        AddObject(gitem);

                        reader.MoveToElement();
                        reader.Skip();
                    }
                    else if (reader.LocalName == "group")
                    {
                        DockGroup grp = new DockGroup(Frame);
                        grp.Read(reader);
                        AddObject(grp);
                    }
                }
                else
                {
                    reader.Skip();
                }
                reader.MoveToContent();
            }
            reader.ReadEndElement();
        }
Example #2
0
		internal override void Read (XmlReader reader)
		{
			base.Read (reader);
			type = (DockGroupType) Enum.Parse (typeof(DockGroupType), reader.GetAttribute ("type"));
			if (type == DockGroupType.Tabbed) {
				string s = reader.GetAttribute ("currentTabPage");
				if (s != null)
					currentTabPage = int.Parse (s);
			}
			
			reader.MoveToElement ();
			if (reader.IsEmptyElement) {
				reader.Skip ();
				return;
			}
			
			reader.ReadStartElement ();
			reader.MoveToContent ();
			while (reader.NodeType != XmlNodeType.EndElement) {
				if (reader.NodeType == XmlNodeType.Element) {
					if (reader.LocalName == "item") {
						string id = reader.GetAttribute ("id");
						DockItem it = Frame.GetItem (id);
						if (it == null) {
							it = Frame.AddItem (id);
							it.IsPositionMarker = true;
						}
						DockGroupItem gitem = new DockGroupItem (Frame, it);
						gitem.Read (reader);
						AddObject (gitem);
						
						reader.MoveToElement ();
						reader.Skip ();
					}
					else if (reader.LocalName == "group") {
						DockGroup grp = new DockGroup (Frame);
						grp.Read (reader);
						AddObject (grp);
					}
				}
				else
					reader.Skip ();
				reader.MoveToContent ();
			}
			reader.ReadEndElement ();
		}