Esempio n. 1
0
        protected override void Render(HtmlTextWriter output)
        {
            Assert.ArgumentNotNull(output, "output");
            Item parentItem = this.ParentItem;

            if (parentItem != null)
            {
                this.RenderChildren(output, parentItem);
            }
            else
            {
                Sitecore.Web.UI.HtmlControls.DataContext dataContext = this.GetDataContext();
                if (dataContext != null)
                {
                    IDataView dataView = dataContext.DataView;
                    if (dataView != null)
                    {
                        Item   item2;
                        Item   item3;
                        string filter = this.GetFilter();
                        dataContext.GetState(out item2, out item3);
                        this.Render(output, dataView, filter, item2, item3);
                    }
                }
            }
        }
Esempio n. 2
0
 private void DataContext_OnChanged(object sender)
 {
     Sitecore.Web.UI.HtmlControls.DataContext dataContext = this.GetDataContext();
     if (dataContext != null)
     {
         this.UpdateFromDataContext(dataContext);
     }
 }
Esempio n. 3
0
        private void UpdateFromDataContext(Sitecore.Web.UI.HtmlControls.DataContext dataContext)
        {
            Assert.ArgumentNotNull(dataContext, "dataContext");
            string parameters   = dataContext.Parameters;
            string filter       = dataContext.Filter;
            string dataViewName = dataContext.DataViewName;

            if (((parameters != this.Parameters) || (filter != this.Filter)) || (dataViewName != this.DataViewName))
            {
                this.Parameters   = parameters;
                this.Filter       = filter;
                this.DataViewName = dataViewName;
                SheerResponse.SetAttribute(this.ID + "_Parameters", "value", this.GetParameters());
            }
        }
Esempio n. 4
0
 protected override void OnLoad(EventArgs e)
 {
     Assert.ArgumentNotNull(e, "e");
     base.OnLoad(e);
     Sitecore.Web.UI.HtmlControls.DataContext dataContext = this.GetDataContext();
     if (dataContext != null)
     {
         dataContext.Changed += new Sitecore.Web.UI.HtmlControls.DataContext.DataContextChangedDelegate(this.DataContext_OnChanged);
         this.UpdateFromDataContext(dataContext);
         Item[] selectedItems = this.GetSelectedItems();
         if (selectedItems.Length > 0)
         {
             dataContext.SetFolder(selectedItems[0].Uri);
         }
     }
 }
Esempio n. 5
0
        private IDataView GetDataView()
        {
            string dataViewName = this.DataViewName;

            if (string.IsNullOrEmpty(dataViewName))
            {
                Sitecore.Web.UI.HtmlControls.DataContext dataContext = this.GetDataContext();
                if (dataContext != null)
                {
                    this.UpdateFromDataContext(dataContext);
                }
                dataViewName = this.DataViewName;
            }
            string parameters = this.Parameters;

            if (string.IsNullOrEmpty(dataViewName))
            {
                parameters = WebUtil.GetFormValue(this.ID + "_Parameters");
                UrlString str3 = new UrlString(parameters);
                dataViewName = str3["dv"];
            }
            return(DataViewFactory.GetDataView(dataViewName, parameters));
        }