How to update ManagementServer configuration?

I create various items with the ManagementServer class. For example user defined events:

MyServer.UserDefinedEventFolder.AddUserDefinedEvent(eventName);

Then I try to get the created event from MyServer.UserDefinedEventFolder.UserDefinedEvents

But it can’t be found until the application restarts. How can I force a refresh?

nvm, I think I found it. MyServer.ClearChildrenCache();