// YT Music Manage

        private void PbYtMusicManage_Click(object sender, EventArgs e)
        {
            ManagingYTMusicStatus           = ManagingYTMusicStatusEnum.Showing;
            Requests.UploadCheckCache.Pause = true;

            if (ManageYTMusic == null || ManageYTMusic.IsDisposed)
            {
                ManageYTMusic = new ManageYTMusic(this);
            }

            SetPaused(true);
            EnableTrayPauseResume(false);

            var result = ManageYTMusic.ShowDialog();

            if (!IsPausedFromTray)
            {
                if (result == DialogResult.Yes)
                {
                    ManagingYTMusicStatus = ManagingYTMusicStatusEnum.CloseChanges;
                    Restart();
                    ManagingYTMusicStatus = ManagingYTMusicStatusEnum.CloseChangesComplete;
                }
                else
                {
                    ManagingYTMusicStatus = ManagingYTMusicStatusEnum.CloseNoChange;
                }

                Requests.UploadCheckCache.Pause = false;
                SetPaused(false);

                pbYtMusicManage.Image = Properties.Resources.ytmusic_manage;
                ThreadPool.QueueUserWorkItem(delegate
                {
                    ThreadHelper.SafeSleep(100);
                    SetManageTYMusicButtonImage(Properties.Resources.ytmusic_manage);
                    ThreadHelper.SafeSleep(250);
                    SetPaused(false);
                });
            }

            EnableTrayPauseResume(true);
        }
Ejemplo n.º 2
0
        // YT Music Manage

        private void PbYtMusicManage_Click(object sender, EventArgs e)
        {
            ManagingYTMusicStatus           = ManagingYTMusicStatusEnum.Showing;
            Requests.UploadCheckCache.Pause = true;

            if (ManageYTMusic == null || ManageYTMusic.IsDisposed)
            {
                ManageYTMusic = new ManageYTMusic(this);
            }

            SetPaused(true);

            var result = ManageYTMusic.ShowDialog();

            if (result == DialogResult.Yes)
            {
                ManagingYTMusicStatus           = ManagingYTMusicStatusEnum.CloseChanges;
                Requests.UploadCheckCache.Pause = false;
                Restart();
                ManagingYTMusicStatus = ManagingYTMusicStatusEnum.CloseChangesComplete;
            }
            else
            {
                Requests.UploadCheckCache.Pause = false;
                ManagingYTMusicStatus           = ManagingYTMusicStatusEnum.CloseNoChange;
            }

            SetPaused(false);

            pbYtMusicManage.Image = Properties.Resources.ytmusic_manage;
            new Thread((ThreadStart) delegate
            {
                Thread.Sleep(100);
                SetManageTYMusicButtonImage(Properties.Resources.ytmusic_manage);
            }).Start();
        }