DockObject SetupObject(XmlNode node) { DockObject obj = null; if (node.Name == "notebook") { DockNotebook dn = new DockNotebook(); dn.Bind(master); dn.FromXml(node); return(dn); } if (node.Name == "paned") { DockPaned dp = new DockPaned(); dp.Bind(master); dp.FromXml(node); return(dp); } string name = null; if (node.Attributes["name"] != null) { name = node.Attributes["name"].Value; } if (name != null && name.Length > 0) { obj = master.GetObject(name); } else { Console.WriteLine("While loading layout: don't know how to create a dock object whose nick is '{0}'", name); } if (obj != null) { obj.FromXml(node); } return(obj); }