예제 #1
0
        public override IEnumerable GetDesignTimeData(int minimumRows, out bool isSampleData)
        {
            string siteMapProvider      = null;
            string startingNodeUrl      = null;
            SiteMapNodeCollection nodes = null;

            siteMapProvider = this._siteMapDataSource.SiteMapProvider;
            startingNodeUrl = this._siteMapDataSource.StartingNodeUrl;
            this._siteMapDataSource.Provider = this._owner.DesignTimeSiteMapProvider;
            try
            {
                this._siteMapDataSource.StartingNodeUrl = null;
                nodes        = ((SiteMapDataSourceView)((IDataSource)this._siteMapDataSource).GetView(base.Name)).Select(DataSourceSelectArguments.Empty) as SiteMapNodeCollection;
                isSampleData = false;
            }
            finally
            {
                this._siteMapDataSource.StartingNodeUrl = startingNodeUrl;
                this._siteMapDataSource.SiteMapProvider = siteMapProvider;
            }
            if ((nodes != null) && (nodes.Count == 0))
            {
                isSampleData = true;
                return(DesignTimeData.GetDesignTimeDataSource(DesignTimeData.CreateDummyDataBoundDataTable(), minimumRows));
            }
            return(nodes);
        }
        protected virtual IEnumerable GetSampleDataSource()
        {
            DataTable dataTable = null;

            if (((DataBoundControl)base.Component).DataSourceID.Length > 0)
            {
                dataTable = DesignTimeData.CreateDummyDataBoundDataTable();
            }
            else
            {
                dataTable = DesignTimeData.CreateDummyDataTable();
            }
            return(DesignTimeData.GetDesignTimeDataSource(dataTable, this.SampleRowCount));
        }