protected override void RenderContents(HtmlTextWriter writer)
        {
            SPSEditorPartsTools tools = new SPSEditorPartsTools(writer);

            tools.DecorateControls(Controls);

            tools.SectionBeginTag();

            tools.SectionHeaderTag(SPSResources.GetResourceString("SPSPE_LinkedTo"));
            ddlWebparts.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag(SPSResources.GetResourceString("SPSPE_MaxLevels"));
            txtMaxLevels.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag();
            chkNavigateToList.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag(SPSResources.GetResourceString("SPSPE_NavigateToListView"));
            ddlListViews.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionEndTag();
        }
        protected override void CreateChildControls()
        {
            ddlWebparts       = new DropDownList();
            ddlWebparts.Width = new Unit("100%");
            SPSEditorPartsTools.FillWebParts(Context, ddlWebparts);
            ddlWebparts.SelectedIndexChanged += ddlWebParts_SelectedIndexChanged;
            ddlWebparts.AutoPostBack          = true;
            Controls.Add(ddlWebparts);

            txtMaxLevels       = new TextBox();
            txtMaxLevels.Width = new Unit("100%");
            txtMaxLevels.Text  = string.Empty;
            Controls.Add(txtMaxLevels);

            chkNavigateToList                 = new CheckBox();
            chkNavigateToList.Text            = SPSResources.GetResourceString("SPSPE_NavigateToList");
            chkNavigateToList.Checked         = false;
            chkNavigateToList.CheckedChanged += chkNavigateToList_CheckedChanged;
            chkNavigateToList.AutoPostBack    = true;
            Controls.Add(chkNavigateToList);

            ddlListViews       = new DropDownList();
            ddlListViews.Width = new Unit("100%");
            Controls.Add(ddlListViews);
        }
        protected override void CreateChildControls()
        {
            txtRootWeb       = new TextBox();
            txtRootWeb.Width = new Unit("100%");
            Controls.Add(txtRootWeb);

            chkShowSubsites         = new CheckBox();
            chkShowSubsites.Text    = SPSResources.GetResourceString("SPSPE_ShowSubsites");
            chkShowSubsites.Checked = false;
            Controls.Add(chkShowSubsites);

            chkShowLists         = new CheckBox();
            chkShowLists.Text    = SPSResources.GetResourceString("SPSPE_ShowLists");
            chkShowLists.Checked = false;
            Controls.Add(chkShowLists);

            chkShowFolders         = new CheckBox();
            chkShowFolders.Text    = SPSResources.GetResourceString("SPSPE_ShowFolders");
            chkShowFolders.Checked = false;
            Controls.Add(chkShowFolders);

            txtFilterWeb       = new TextBox();
            txtFilterWeb.Width = new Unit("100%");
            Controls.Add(txtFilterWeb);

            txtFilterList       = new TextBox();
            txtFilterList.Width = new Unit("100%");
            Controls.Add(txtFilterList);

            txtExpandDepth       = new TextBox();
            txtExpandDepth.Width = new Unit("100%");
            Controls.Add(txtExpandDepth);
        }
        private SPWeb GetWebToUse()
        {
            SPWeb web = null;

            if (!string.IsNullOrEmpty(_rootWeb))
            {
                try
                {
                    using (SPSite site = new SPSite(_rootWeb))
                    {
                        web = site.OpenWeb();
                    }
                }
                catch (Exception)
                {
                    ErrorMessage += string.Format("<br>" + SPSResources.GetResourceString("SPS_Err_Open_Url"), _rootWeb);
                }
            }
            else
            {
                web = SPContext.Current.Web.Site.OpenWeb();
            }

            return(web);
        }
        protected override void CreateChildControls()
        {
            ddlWebparts       = new DropDownList();
            ddlWebparts.Width = new Unit("100%");
            SPSEditorPartsTools.FillWebParts(Context, ddlWebparts);
            ddlWebparts.SelectedIndexChanged += ddlWebParts_SelectedIndexChanged;
            ddlWebparts.AutoPostBack          = true;
            Controls.Add(ddlWebparts);

            txtFilter       = new TextBox();
            txtFilter.Width = new Unit("100%");
            Controls.Add(txtFilter);

            chkFollowListView                 = new CheckBox();
            chkFollowListView.Text            = SPSResources.GetResourceString("SPSPE_FollowListView");
            chkFollowListView.Checked         = false;
            chkFollowListView.AutoPostBack    = true;
            chkFollowListView.CheckedChanged += chkFollowListView_CheckedChanged;
            chkFollowListView.ToolTip         = SPSResources.GetResourceString("SPSPE_FollowListViewTip");
            Controls.Add(chkFollowListView);

            chkNavigateToList                 = new CheckBox();
            chkNavigateToList.Text            = SPSResources.GetResourceString("SPSPE_NavigateToList");
            chkNavigateToList.Checked         = false;
            chkNavigateToList.AutoPostBack    = true;
            chkNavigateToList.CheckedChanged += chkNavigateToList_CheckedChanged;
            chkNavigateToList.ToolTip         = SPSResources.GetResourceString("SPSPE_NavigateToListTip");
            Controls.Add(chkNavigateToList);

            chkSortHierarchy              = new CheckBox();
            chkSortHierarchy.Text         = SPSResources.GetResourceString("SPSPE_SortHierarchy");
            chkSortHierarchy.Checked      = false;
            chkSortHierarchy.AutoPostBack = true;
            chkSortHierarchy.ToolTip      = SPSResources.GetResourceString("SPSPE_SortHierarchyTip");
            Controls.Add(chkSortHierarchy);


            ddlListViews       = new DropDownList();
            ddlListViews.Width = new Unit("100%");
            Controls.Add(ddlListViews);

            chkShowCounter         = new CheckBox();
            chkShowCounter.Text    = SPSResources.GetResourceString("SPSPE_ShowFileCounter");
            chkShowCounter.Checked = false;
            chkShowCounter.ToolTip = SPSResources.GetResourceString("SPSPR_ShowFileCounterTip");
            Controls.Add(chkShowCounter);

            txtExpandDepth       = new TextBox();
            txtExpandDepth.Width = new Unit("100%");
            Controls.Add(txtExpandDepth);

            chkHideStartUnder         = new CheckBox();
            chkHideStartUnder.Text    = SPSResources.GetResourceString("SPSPE_HideUnderScoreFolders");
            chkHideStartUnder.Checked = false;
            chkHideStartUnder.ToolTip = SPSResources.GetResourceString("SPSPE_HideUnderScoreFoldersTip");
            Controls.Add(chkHideStartUnder);
        }
        protected override void RenderContents(HtmlTextWriter writer)
        {
            SPSEditorPartsTools tools = new SPSEditorPartsTools(writer);

            tools.DecorateControls(Controls);

            tools.SectionBeginTag();

            tools.SectionHeaderTag(SPSResources.GetResourceString("SPSPE_LinkedTo"));
            ddlWebparts.RenderControl(writer);

            tools.SectionFooterTag();

            tools.SectionHeaderTag(SPSResources.GetResourceString("SPSPE_Filter"));
            txtFilter.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag(SPSResources.GetResourceString("SPSPE_Behaviour"));
            chkFollowListView.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag();
            chkNavigateToList.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag();
            chkSortHierarchy.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag();
            ddlListViews.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag();
            chkShowCounter.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag(SPSResources.GetResourceString("SPSPE_TreeExpandDepth"));
            txtExpandDepth.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag();
            chkHideStartUnder.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionEndTag();
        }
        protected override void RenderContents(HtmlTextWriter writer)
        {
            SPSEditorPartsTools tools = new SPSEditorPartsTools(writer);

            tools.DecorateControls(Controls);

            tools.SectionBeginTag();

            tools.SectionHeaderTag(SPSResources.GetResourceString("SPSPE_TopUrl"));
            txtRootWeb.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag();
            chkShowSubsites.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag();
            chkShowLists.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag();
            chkShowFolders.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag(SPSResources.GetResourceString("SPSPE_FilterWeb"));
            txtFilterWeb.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag(SPSResources.GetResourceString("SPSPE_FilterList"));
            txtFilterList.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionHeaderTag(SPSResources.GetResourceString("SPSPE_TreeExpandDepth"));
            txtExpandDepth.RenderControl(writer);
            tools.SectionFooterTag();

            tools.SectionEndTag();
        }