예제 #1
0
        private void RestoreServices()
        {
            LockUi();
            var form = new AuthProgressForm(Program.DefaultPluginManager.ServicesEnumerable());

            form.HiddenOrClosed += (sender, args) => UnlockUi();
            form.Show(this);
        }
예제 #2
0
        public AuthProgressForm RestoreSingle(MusicService service)
        {
            if (!am.CanRestore(service))
            {
                TaskDialogHelper.ShowMessage(caption: "Cannot restore this service right now.",
                                             message: "The service is already being restored in the background. Please try again in a moment.",
                                             icon: TaskDialogStandardIcon.Error, buttons: TaskDialogStandardButtons.Ok, owner: parent.Handle);
                return(null);
            }
            var form = new AuthProgressForm(new[] { service });

            form.Show(parent);
            return(form);
        }
예제 #3
0
        private void restoreButton_Click(object sender, EventArgs e)
        {
            if (!am.CanRestore(service))
            {
                TaskDialogHelper.ShowMessage(caption: "Cannot restore this service right now.",
                                             message: "The service is already being restored in the background. Please try again in a moment.",
                                             icon: TaskDialogStandardIcon.Error, buttons: TaskDialogStandardButtons.Ok, owner: Handle);
                return;
            }
            var form = new AuthProgressForm(new[] { service });

            form.Closed += (o, args) =>
            {
                UpdateViews();
                servicePlugin.SettingsFile.Save();
            };
            form.Show(this);
        }