Beispiel #1
0
        public virtual XPathNodeIterator GetDataSourceIDs(
            string dataSource,
            XPathNodeIterator iterator)
        {
            if (string.IsNullOrEmpty(dataSource))
            {
                return(this.CreateEmptyIterator());
            }

            SC.Xml.Packet packet = new SC.Xml.Packet("values", new string[0]);
            iterator.MoveNext();
            SC.Sharedsource.Web.UI.DataSourceHelper helper =
                new SC.Sharedsource.Web.UI.DataSourceHelper(dataSource, this.GetItem(iterator))
            {
                StoreUISearchResults = true,
            };

            if (helper.Items != null)
            {
                foreach (SC.Data.Items.Item item in helper.Items)
                {
                    if (item != null)
                    {
                        packet.AddElement("value", item.ID.ToString());
                    }
                }
            }

            return(this.GetChildIterator(packet));
        }
Beispiel #2
0
        public SublayoutParameterHelper(
            UserControl control,
            bool applyProperties)
        {
            this.BindingControl = control.Parent as SC.Web.UI.WebControls.Sublayout;

            if (this.BindingControl == null)
            {
                return;
            }

            this.DataSource = new SC.Sharedsource.Web.UI.DataSourceHelper(
                this.BindingControl.DataSource,
                SC.Context.Item)
            {
                StoreUISearchResults = true,
            };

            this.Parameters = SC.Web.WebUtil.ParseUrlParameters(
                this.BindingControl.Parameters);

            if (applyProperties)
            {
                this.ApplyProperties(control);
            }
        }