static void GetFieldsToBind(List <ObjectBindInfo> tobind, ObjectWrapper wrapper) { string memberName = null; if (wrapper is Wrapper.Widget) { Wrapper.Widget ww = wrapper as Wrapper.Widget; if (!String.IsNullOrEmpty(ww.UIManagerName)) { tobind.Add(new ObjectBindInfo("Gtk.UIManager", ww.UIManagerName)); } if (!ww.IsTopLevel && ww.InternalChildProperty == null && !ww.Unselectable) { memberName = ((Wrapper.Widget)wrapper).Wrapped.Name; } } else if (wrapper is Wrapper.Action) { memberName = ((Wrapper.Action)wrapper).Name; } if (memberName != null) { ObjectBindInfo binfo = new ObjectBindInfo(wrapper.WrappedTypeName, memberName); tobind.Add(binfo); } Wrapper.ActionGroup agroup = wrapper as Wrapper.ActionGroup; if (agroup != null) { foreach (Wrapper.Action ac in agroup.Actions) { GetFieldsToBind(tobind, ac); } } Wrapper.Widget widget = wrapper as Wrapper.Widget; if (widget != null && widget.IsTopLevel) { // Generate fields for local actions foreach (Wrapper.ActionGroup grp in widget.LocalActionGroups) { GetFieldsToBind(tobind, grp); } } Gtk.Container cont = wrapper.Wrapped as Gtk.Container; if (cont != null) { foreach (Gtk.Widget child in cont.AllChildren) { Stetic.Wrapper.Widget ww = Stetic.Wrapper.Widget.Lookup(child); if (ww != null) { GetFieldsToBind(tobind, ww); } } } }
static void GetFieldsToBind (List<ObjectBindInfo> tobind, ObjectWrapper wrapper) { string memberName = null; if (wrapper is Wrapper.Widget) { Wrapper.Widget ww = wrapper as Wrapper.Widget; if (!String.IsNullOrEmpty (ww.UIManagerName)) tobind.Add (new ObjectBindInfo ("Gtk.UIManager", ww.UIManagerName)); if (!ww.IsTopLevel && ww.InternalChildProperty == null && !ww.Unselectable) memberName = ((Wrapper.Widget) wrapper).Wrapped.Name; } else if (wrapper is Wrapper.Action) memberName = ((Wrapper.Action) wrapper).Name; if (memberName != null) { ObjectBindInfo binfo = new ObjectBindInfo (wrapper.WrappedTypeName, memberName); tobind.Add (binfo); } Wrapper.ActionGroup agroup = wrapper as Wrapper.ActionGroup; if (agroup != null) { foreach (Wrapper.Action ac in agroup.Actions) GetFieldsToBind (tobind, ac); } Wrapper.Widget widget = wrapper as Wrapper.Widget; if (widget != null && widget.IsTopLevel) { // Generate fields for local actions foreach (Wrapper.ActionGroup grp in widget.LocalActionGroups) { GetFieldsToBind (tobind, grp); } } Gtk.Container cont = wrapper.Wrapped as Gtk.Container; if (cont != null) { foreach (Gtk.Widget child in cont.AllChildren) { Stetic.Wrapper.Widget ww = Stetic.Wrapper.Widget.Lookup (child); if (ww != null) GetFieldsToBind (tobind, ww); } } }