Stetic.Project.NotifyWidgetNameChanged C# (CSharp) Method

NotifyWidgetNameChanged() private method

private NotifyWidgetNameChanged ( object obj, string oldName, string newName, bool isRoot ) : void
obj object
oldName string
newName string
isRoot bool
return void
        internal void NotifyWidgetNameChanged(object obj, string oldName, string newName, bool isRoot)
        {
            WidgetComponent c = obj != null ? (WidgetComponent) App.GetComponent (obj, null, null) : null;
            if (c != null)
                c.UpdateName (newName);

            if (isRoot) {
                WidgetInfo wi = GetWidget (oldName);
                if (wi != null)
                    wi.NotifyNameChanged (newName);
            }

            GuiDispatch.InvokeSync (
                delegate {
                    if (c != null) {
                        if (ComponentNameChanged != null)
                            ComponentNameChanged (this, new ComponentNameEventArgs (this, c, oldName));
                    }
                }
            );
        }

Usage Example

 void OnWidgetNameChanged(Stetic.Wrapper.WidgetNameChangedArgs args, bool isTopLevel)
 {
     if (frontend != null)
     {
         frontend.NotifyWidgetNameChanged(Component.GetSafeReference(args.WidgetWrapper), args.OldName, args.NewName, isTopLevel);
     }
     if (args.WidgetWrapper != null && WidgetNameChanged != null)
     {
         WidgetNameChanged(this, args);
     }
 }
All Usage Examples Of Stetic.Project::NotifyWidgetNameChanged