Пример #1
0
 private void OnDeleteAlbumInfo()
 {
   MusicDatabaseReorg dbreorg = new MusicDatabaseReorg();
   dbreorg.DeleteAlbumInfo();
 }
Пример #2
0
 private void OnDeleteAlbumInfo()
 {
   var dbreorg = new MusicDatabaseReorg(GetID);
   dbreorg.DeleteAlbumInfo();
 }
    public override bool OnMessage(GUIMessage message)
    {
      switch (message.Message)
      {
        case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT:
          {
            base.OnMessage(message);
            LoadSettings();

            if (m_bAutoShuffle)
            {
              GUIControl.SelectControl(GetID, (int)Controls.CONTROL_AUTOSHUFFLE);
            }
            return true;
          }

        case GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT:
          {
            SaveSettings();
          }
          break;

        case GUIMessage.MessageType.GUI_MSG_CLICKED:
          {
            int iControl = message.SenderControlId;

            if (iControl == (int)Controls.CONTROL_AUTOSHUFFLE)
            {
              m_bAutoShuffle = !m_bAutoShuffle;
            }

            if (iControl == (int)Controls.CONTROL_BTNDELALBUMINFO)
            {
              MusicDatabaseReorg dbreorg = new MusicDatabaseReorg();
              dbreorg.DeleteAlbumInfo();
            }
            if (iControl == (int)Controls.CONTROL_BTNDELALBUM)
            {
              MusicDatabaseReorg dbreorg = new MusicDatabaseReorg();
              dbreorg.DeleteSingleAlbum();
            }

            if (iControl == (int)Controls.CONTROL_BTNREORGDB)
            {
              GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_YES_NO);
              if (null != dlgYesNo)
              {
                dlgYesNo.SetHeading(333);
                dlgYesNo.SetLine(1, "");
                dlgYesNo.SetLine(2, "");
                dlgYesNo.SetLine(3, "");
                dlgYesNo.DoModal(GetID);

                if (dlgYesNo.IsConfirmed)
                {
                  MusicDatabaseReorg reorg = new MusicDatabaseReorg(GetID);
                  Work work = new Work(new DoWorkHandler(reorg.ReorgAsync));
                  work.ThreadPriority = ThreadPriority.Lowest;
                  GlobalServiceProvider.Get<IThreadPool>().Add(work, QueuePriority.Low);
                }
              }
            }
          }
          break;
      }
      return base.OnMessage(message);
    }
Пример #4
0
        private void OnDeleteAlbumInfo()
        {
            var dbreorg = new MusicDatabaseReorg(GetID);

            dbreorg.DeleteAlbumInfo();
        }
Пример #5
0
        public override bool OnMessage(GUIMessage message)
        {
            switch (message.Message)
            {
            case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT:
            {
                base.OnMessage(message);
                LoadSettings();

                if (m_bAutoShuffle)
                {
                    GUIControl.SelectControl(GetID, (int)Controls.CONTROL_AUTOSHUFFLE);
                }
                return(true);
            }

            case GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT:
            {
                SaveSettings();
            }
            break;

            case GUIMessage.MessageType.GUI_MSG_CLICKED:
            {
                int iControl = message.SenderControlId;

                if (iControl == (int)Controls.CONTROL_AUTOSHUFFLE)
                {
                    m_bAutoShuffle = !m_bAutoShuffle;
                }

                if (iControl == (int)Controls.CONTROL_BTNDELALBUMINFO)
                {
                    MusicDatabaseReorg dbreorg = new MusicDatabaseReorg();
                    dbreorg.DeleteAlbumInfo();
                }
                if (iControl == (int)Controls.CONTROL_BTNDELALBUM)
                {
                    MusicDatabaseReorg dbreorg = new MusicDatabaseReorg();
                    dbreorg.DeleteSingleAlbum();
                }

                if (iControl == (int)Controls.CONTROL_BTNREORGDB)
                {
                    GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_YES_NO);
                    if (null != dlgYesNo)
                    {
                        dlgYesNo.SetHeading(333);
                        dlgYesNo.SetLine(1, "");
                        dlgYesNo.SetLine(2, "");
                        dlgYesNo.SetLine(3, "");
                        dlgYesNo.DoModal(GetID);

                        if (dlgYesNo.IsConfirmed)
                        {
                            MusicDatabaseReorg reorg = new MusicDatabaseReorg(GetID);
                            Work work = new Work(new DoWorkHandler(reorg.ReorgAsync));
                            work.ThreadPriority = ThreadPriority.Lowest;
                            GlobalServiceProvider.Get <IThreadPool>().Add(work, QueuePriority.Low);
                        }
                    }
                }
            }
            break;
            }
            return(base.OnMessage(message));
        }