Stetic.Project.NotifyWidgetAdded C# (CSharp) Method

NotifyWidgetAdded() private method

private NotifyWidgetAdded ( object obj, string name, string typeName ) : void
obj object
name string
typeName string
return void
        internal void NotifyWidgetAdded(object obj, string name, string typeName)
        {
            GuiDispatch.InvokeSync (
                delegate {
                    Component c = App.GetComponent (obj, name, typeName);
                    if (c != null) {
                        WidgetInfo wi = GetWidget (c.Name);
                        if (wi == null) {
                            wi = new WidgetInfo (this, c);
                            widgets.Add (wi);
                        }
                        if (WidgetAdded != null)
                            WidgetAdded (this, new WidgetInfoEventArgs (this, wi));
                    }
                }
            );
        }

Usage Example

コード例 #1
0
        public void AddWidget(Gtk.Widget widget)
        {
            if (!typeof(Gtk.Container).IsInstanceOfType(widget))
            {
                throw new System.ArgumentException("widget", "Only containers can be top level widgets");
            }
            topLevels.Add(new WidgetData(null, null, widget));

            if (!loading)
            {
                Stetic.Wrapper.Widget ww = Stetic.Wrapper.Widget.Lookup(widget);
                if (ww == null)
                {
                    throw new InvalidOperationException("Widget not wrapped");
                }
                if (frontend != null)
                {
                    frontend.NotifyWidgetAdded(Component.GetSafeReference(ww), widget.Name, ww.ClassDescriptor.Name);
                }
                OnWidgetAdded(new Stetic.Wrapper.WidgetEventArgs(ww));
            }
        }