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));
}
}
);
}