Exemplo n.º 1
0
        private void LibraryProviderChanged(LibraryProvider previousLibraryProvider, LibraryProvider currentLibraryProvider)
        {
            if (currentLibraryProvider.IsProtected())
            {
                addToLibraryButton.Enabled = false;
                createFolderButton.Enabled = false;
                searchPanel.Visible        = false;
                DoLeaveEditMode();
            }
            else
            {
                addToLibraryButton.Enabled = true;
                createFolderButton.Enabled = true;
                searchPanel.Visible        = true;
            }

            if (previousLibraryProvider != null)
            {
                previousLibraryProvider.KeywordFilter = "";
                previousLibraryProvider.DataReloaded -= UpdateStatus;
            }

            searchInput.Text = currentLibraryProvider.KeywordFilter;
            breadCrumbWidget.SetBreadCrumbs(null, this.libraryDataView.CurrentLibraryProvider);

            currentLibraryProvider.DataReloaded += UpdateStatus;

            UpdateStatus(null, null);
        }