protected override ObjectWrapper ReadChild(ObjectReader reader, XmlElement child_elem) { Widget wrapper = Stetic.Wrapper.Widget.Lookup(optionmenu.Menu); reader.ReadExistingObject(wrapper, child_elem["widget"]); return(wrapper); }
protected override ObjectWrapper ReadChild (ObjectReader reader, XmlElement child_elem) { Widget wrapper = Stetic.Wrapper.Widget.Lookup (optionmenu.Menu); reader.ReadExistingObject (wrapper, child_elem["widget"]); return wrapper; }
protected virtual ObjectWrapper ReadInternalChild (ObjectReader reader, XmlElement child_elem) { ClassDescriptor klass = base.ClassDescriptor; string childId = child_elem.GetAttribute ("internal-child"); foreach (PropertyDescriptor prop in klass.InternalChildren) { if (reader.Format == FileFormat.Glade && ((TypedPropertyDescriptor)prop).GladeName != childId) continue; else if (reader.Format == FileFormat.Native && prop.Name != childId) continue; Gtk.Widget child = prop.GetValue (container) as Gtk.Widget; Widget wrapper = Widget.Lookup (child); if (wrapper != null) { reader.ReadExistingObject (wrapper, child_elem["widget"]); if (reader.Format == FileFormat.Glade) GladeUtils.SetPacking (ChildWrapper (wrapper), child_elem); else WidgetUtils.SetPacking (ChildWrapper (wrapper), child_elem); return wrapper; } } // In Glade, internal children may not be direct children of the root container. This is handled in a special way. if (reader.Format == FileFormat.Glade) { if (!reader.GladeChildStack.Contains (child_elem)) reader.GladeChildStack.Add (child_elem); return null; } else throw new GladeException ("Unrecognized internal child name", Wrapped.GetType ().FullName, false, "internal-child", childId); }