Beispiel #1
0
        public override void SyncChanges()
        {
            EnsureChildControls();
            FolderExplorer webpart = WebPartToEdit as FolderExplorer;

            if (webpart != null)
            {
                chkFollowListView.Checked = webpart.FollowListView;
                chkNavigateToList.Checked = webpart.NavigateToList;
                chkShowCounter.Checked    = webpart.ShowCounter;
                txtFilter.Text            = webpart.Filter;
                chkHideStartUnder.Checked = webpart.HideStartUnder;
                txtExpandDepth.Text       = webpart.ExpandDepth.ToString();

                // Initialize
                chkNavigateToList.Enabled = !chkFollowListView.Checked;
                chkFollowListView.Enabled = !chkNavigateToList.Checked;
                ddlWebparts.Enabled       = !chkNavigateToList.Checked;

                if (!string.IsNullOrEmpty(webpart.ListViewGuid))
                {
                    DropDownSelect(ddlWebparts, webpart.ListViewGuid);
                    ddlWebParts_SelectedIndexChanged(null, null);
                    DropDownSelect(ddlListViews, webpart.NavigateToListView);
                }
            }
        }
Beispiel #2
0
        public override bool ApplyChanges()
        {
            EnsureChildControls();
            FolderExplorer webpart = WebPartToEdit as FolderExplorer;

            if (webpart != null)
            {
                webpart.ListGuid = SPSEditorPartsTools.GetListGuidFromListViewGuid(Context,
                                                                                   ddlWebparts.SelectedValue);
                webpart.ListViewGuid       = ddlWebparts.SelectedValue;
                webpart.FollowListView     = chkFollowListView.Checked;
                webpart.NavigateToList     = chkNavigateToList.Checked;
                webpart.NavigateToListView = ddlListViews.SelectedValue;
                webpart.ShowCounter        = chkShowCounter.Checked;
                webpart.Filter             = txtFilter.Text.ToUpper();
                webpart.HideStartUnder     = chkHideStartUnder.Checked;

                int converted;
                if (int.TryParse(txtExpandDepth.Text, out converted))
                {
                    webpart.ExpandDepth = converted;
                }

                webpart.ClearControlState();
                webpart.ClearCache();
                return(true);
            }
            return(false);
        }