public void OnClick(Window mainWindow, Instance instance)
        {
            using (new ProfileSection("Refresh main window instances", this))
            {
                ProfileSection.Argument("mainWindow", mainWindow);
                ProfileSection.Argument("instance", instance);

                var refreshMode = this.GetMode(mainWindow);
                switch (refreshMode)
                {
                case RefreshMode.Instances:
                    MainWindowHelper.RefreshInstances();
                    return;

                case RefreshMode.Installer:
                    MainWindowHelper.RefreshInstaller();
                    return;

                case RefreshMode.Caches:
                    MainWindowHelper.RefreshCaches();
                    return;

                case RefreshMode.Everything:
                    MainWindowHelper.RefreshEverything();
                    return;
                }
            }
        }