Beispiel #1
0
        private void UninstallPreferences(Sources.SourceEventArgs args)
        {
            if (!args.Source.Equals(music_lib))
            {
                return;
            }

            music_lib.PreferencesPage["misc"].Remove(disable_album_grid);
            music_lib = null;

            ServiceManager.SourceManager.SourceRemoved -= UninstallPreferences;
        }
        /// <summary>
        /// Watches source changes and dynamically adds/removes the record button in the toolbar
        /// </summary>
        /// <param name="args">
        /// A <see cref="Sources.SourceEventArgs"/> -- not used
        /// </param>
        void OnSourceChanged(Sources.SourceEventArgs args)
        {
            PrimarySource primary_source = action_service.GlobalActions.ActivePrimarySource;

            if (primary_source == null)
            {
                return;
            }

            if (!primary_source.IsLocal && ui_button_id == 0)
            {
                ui_button_id = action_service.UIManager.AddUiFromResource("StreamrecorderButton.xml");
            }
            if (primary_source.IsLocal && ui_button_id > 0)
            {
                action_service.UIManager.RemoveUi(ui_button_id);
                ui_button_id = 0;
            }
        }