• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UI.DataSourceSelectArguments类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Web.UI.DataSourceSelectArguments的典型用法代码示例。如果您正苦于以下问题:C# DataSourceSelectArguments类的具体用法?C# DataSourceSelectArguments怎么用?C# DataSourceSelectArguments使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DataSourceSelectArguments类属于System.Web.UI命名空间,在下文中一共展示了DataSourceSelectArguments类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Equals

		public void Equals ()
		{
			DataSourceSelectArguments arg1 = new DataSourceSelectArguments ();
			DataSourceSelectArguments arg2 = DataSourceSelectArguments.Empty;

			Assert.IsTrue (arg1.Equals (arg2), "Equals#1");
			Assert.IsTrue (arg1.GetHashCode () == arg2.GetHashCode (), "GetHashCode#1");

			arg1.SortExpression = "sort";
			arg1.MaximumRows = 10;
			arg1.StartRowIndex = 5;
			arg1.RetrieveTotalRowCount = true;
			arg1.TotalRowCount = 30;

			Assert.IsFalse (arg1.Equals (arg2), "Equals#2");
			Assert.IsFalse (arg1.GetHashCode () == arg2.GetHashCode (), "GetHashCode#2");

			arg2.SortExpression = "sort";
			arg2.MaximumRows = 10;
			arg2.StartRowIndex = 5;

			Assert.IsFalse (arg1.Equals (arg2), "Equals#3");
			Assert.IsFalse (arg1.GetHashCode () == arg2.GetHashCode (), "GetHashCode#3");

			arg2.RetrieveTotalRowCount = true;
			arg2.TotalRowCount = 30;

			Assert.IsTrue (arg1.Equals (arg2), "Equals#4");
			Assert.IsTrue (arg1.GetHashCode () == arg2.GetHashCode (), "GetHashCode#4");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:30,代码来源:DataSourceSelectArgumentsTest.cs


示例2: ExecuteSelect

        protected override IEnumerable ExecuteSelect(DataSourceSelectArguments selectArgs)
        {
            // only continue if a membership provider has been configured
            if (!Utils.IsProviderConfigured())
                return null;

            // get roles and build data table
            DataTable dataTable = new DataTable();
            String[] roles = Utils.BaseRoleProvider().GetAllRoles();
            dataTable.Columns.Add("Role");
            dataTable.Columns.Add("UsersInRole");

            // add users in role counts
            for (int i = 0; i < roles.Length; i++)
            {
                DataRow row = dataTable.NewRow();
                row["Role"] = roles[i];
                row["UsersInRole"] = Utils.BaseRoleProvider().GetUsersInRole(roles[i].ToString()).Length;
                dataTable.Rows.Add(row);
            }
            dataTable.AcceptChanges();
            DataView dataView = new DataView(dataTable);

            // sort if a sort expression available
            if (selectArgs.SortExpression != String.Empty)
            {
                dataView.Sort = selectArgs.SortExpression;
            }

            // return as a DataList
            return (IEnumerable) dataView;
        }
开发者ID:NIEM-Web,项目名称:Sharepoint,代码行数:32,代码来源:FBARolesView.cs


示例3: ExecuteSelect

		protected override IEnumerable ExecuteSelect(DataSourceSelectArguments arguments)
		{
			if (this.dataSourceControl.Enabled == true)
			{
				IOrderedDictionary parameters = this.dataSourceControl.DataParameters.GetValues(HttpContext.Current, this.dataSourceControl);
				DataEventArgs args = new DataEventArgs(this.dataSourceControl.PageSize, arguments.StartRowIndex, arguments.SortExpression, parameters);

				this.dataSourceControl.GetData(args);

				arguments.TotalRowCount = args.TotalRowCount;
				arguments.MaximumRows = this.dataSourceControl.PageSize;
				arguments.AddSupportedCapabilities(DataSourceCapabilities.Page | DataSourceCapabilities.Sort | DataSourceCapabilities.RetrieveTotalRowCount);
				arguments.RetrieveTotalRowCount = true;

				if (!(args.Data is ICollection))
				{
					return (args.Data.OfType<Object>().ToList());
				}
				else
				{
					return (args.Data);
				}
			}
			else
			{
				arguments.TotalRowCount = 0;
				return (new ArrayList());
			}
		}
开发者ID:rjperes,项目名称:DevelopmentWithADot.AspNetCustomDataSourceControl,代码行数:29,代码来源:CustomDataSourceView.cs


示例4: GetTableData

		public IList GetTableData (string tableName, DataSourceSelectArguments args, string where, ParameterCollection whereParams)
		{
			if (String.Compare (tableName, "BazValidationAttributesTable", StringComparison.OrdinalIgnoreCase) == 0)
				return BazValidationAttributes;

			return null;
		}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:TestDataContext4.cs


示例5: ExecuteSelect

		/// <summary>
		/// Iterates through the <see cref="Navigation.Crumb"/> contents of <see cref="Navigation.StateController.Crumbs"/>
		/// </summary>
		/// <param name="arguments">This parameter is ignored</param>
		/// <returns>An <see cref="System.Collections.IEnumerable"/> list of <see cref="Navigation.Crumb"/> items</returns>
		protected override IEnumerable ExecuteSelect(DataSourceSelectArguments arguments)
		{
			foreach (Crumb crumb in StateController.Crumbs)
			{
				yield return crumb;
			}
		}
开发者ID:ericziko,项目名称:navigation,代码行数:12,代码来源:CrumbTrailDataSourceView.cs


示例6: BindData

        private void BindData()
        {
            SqlDataSource1.DataBind();
            //string sqlquery = "SELECT * FROM [ISBEPI_DEV].[dbo].[HomeVisitorSiteVisitSurvey] WHERE Schd_ID = 16";
            DataTable dt = new DataTable();
            DataSourceSelectArguments args = new DataSourceSelectArguments();
            DataView view = (DataView)SqlDataSource1.Select(args);
            dt = view.ToTable();
            DataSet ds = new DataSet();
            ds.Tables.Add(dt);
            DataSet new_ds = FlipDataSet(ds); // Flip the DataSet
            DataView my_DataView = new_ds.Tables[0].DefaultView;
            this.DataGrid1.DataSource = my_DataView;
            this.DataGrid1.DataBind();

            DataTable dt2 = new DataTable();
            DataSourceSelectArguments args2 = new DataSourceSelectArguments();
            DataView view2 = (DataView)SqlDataSource2.Select(args2);
            dt2 = view2.ToTable();
            DataSet ds2 = new DataSet();
            ds2.Tables.Add(dt2);
            DataSet new_ds2 = FlipDataSet(ds2); // Flip the DataSet
            DataView my_DataView2 = new_ds2.Tables[0].DefaultView;
            this.DataGrid2.DataSource = my_DataView2;
            this.DataGrid2.DataBind();
        }
开发者ID:saltmktg,项目名称:isbepi.erikson.edu,代码行数:26,代码来源:PDtoExcel.aspx.cs


示例7: ExecuteSelect

 protected internal override IEnumerable ExecuteSelect(DataSourceSelectArguments arguments)
 {
     if (string.IsNullOrEmpty(this._owner.DataFile))
     {
         throw new InvalidOperationException(System.Web.SR.GetString("AccessDataSourceView_SelectRequiresDataFile", new object[] { this._owner.ID }));
     }
     return base.ExecuteSelect(arguments);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:AccessDataSourceView.cs


示例8: Select

        /// <summary>
        /// Gets a list of data asynchronously from the underlying data storage.
        /// </summary>
        /// <param name="arguments">A <see cref="T:System.Web.UI.DataSourceSelectArguments"></see> that is used to request operations on the data beyond basic data retrieval.</param>
        /// <param name="callback">A <see cref="T:System.Web.UI.DataSourceViewSelectCallback"></see> delegate that is used to notify a data-bound control when the asynchronous operation is complete.</param>
        /// <exception cref="T:System.ArgumentNullException">The <see cref="T:System.Web.UI.DataSourceViewSelectCallback"></see> supplied is null.</exception>
        public override void Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
        {
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }

            callback(ExecuteSelect(arguments));
        }
开发者ID:Throy,项目名称:derp-octo-robot,代码行数:15,代码来源:RssDataSourceView.cs


示例9: ExecuteSelect

        protected override IEnumerable ExecuteSelect(DataSourceSelectArguments arguments)
        {
            GenericSelectArgs args = new GenericSelectArgs(arguments)
            {
            };

            var theResult = this.Owner.Select(args);

            return theResult;
        }
开发者ID:simonegli8,项目名称:Silversite,代码行数:10,代码来源:GenericDataSourceView.cs


示例10: QueryContext

 public QueryContext(IDictionary<string, object> whereParameters,
     IDictionary<string, object> orderGroupsByParameters,
     IOrderedDictionary orderByParameters,
     IDictionary<string, object> groupByParameters,
     IDictionary<string, object> selectParameters, 
     DataSourceSelectArguments arguments) {
     WhereParameters = whereParameters;
     OrderByParameters = orderByParameters;
     OrderGroupsByParameters = orderGroupsByParameters;
     SelectParameters = selectParameters;
     GroupByParameters = groupByParameters;
     Arguments = arguments;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:13,代码来源:QueryContext.cs


示例11: GetTableData

		public IList GetTableData (string tableName, DataSourceSelectArguments args, string where, ParameterCollection whereParams)
		{
			if (String.Compare (tableName, "AssociatedFooTable", StringComparison.OrdinalIgnoreCase) == 0)
				return AssociatedFoo;

			if (String.Compare (tableName, "AssociatedBarTable", StringComparison.OrdinalIgnoreCase) == 0)
				return AssociatedBar;

			if (String.Compare (tableName, "BazWithDataTypeAttributeTable", StringComparison.OrdinalIgnoreCase) == 0)
				return BazWithDataTypeAttribute;

			return null;
		}
开发者ID:nobled,项目名称:mono,代码行数:13,代码来源:TestDataContext3.cs


示例12: GetTableData

		public IList GetTableData (string tableName, DataSourceSelectArguments args, string where, ParameterCollection whereParams)
		{
			if (String.Compare (tableName, "EmployeeTable", StringComparison.OrdinalIgnoreCase) == 0)
				return Employees;

			if (String.Compare (tableName, "SeasonalEmployeeTable", StringComparison.OrdinalIgnoreCase) == 0)
				return SeasonalEmployees;

			if (String.Compare (tableName, "BazDataTypeDefaultTypesTable", StringComparison.OrdinalIgnoreCase) == 0)
				return DefaultDataTypes;

			return null;
		}
开发者ID:nobled,项目名称:mono,代码行数:13,代码来源:EmployeesDataContext.cs


示例13: BindData

 private void BindData()
 {
     SqlDataSource1.DataBind();          
     DataTable dt = new DataTable();
     DataSourceSelectArguments args = new DataSourceSelectArguments();
     DataView view = (DataView)SqlDataSource2.Select(args);
     dt = view.ToTable();
     DataSet ds = new DataSet();
     ds.Tables.Add(dt);
     DataSet new_ds = FlipDataSet(ds); // Flip the DataSet
     DataView my_DataView = new_ds.Tables[0].DefaultView;
     this.DataGrid1.DataSource = my_DataView;
     this.DataGrid1.DataBind();
 }
开发者ID:saltmktg,项目名称:isbepi.erikson.edu,代码行数:14,代码来源:HVInterviewtoExcel.aspx.cs


示例14: SelectingEventArgs

        /// <summary>
        /// 
        /// </summary>
        /// <param name="arguments"></param>
        /// <param name="parameters"></param>
        /// <param name="sourceType"></param>
        public SelectingEventArgs(DataSourceSelectArguments arguments, IDictionary parameters, Type sourceType)
            : base(sourceType)
        {
            if (arguments == null)
                throw new ControlParameterException("The arguments for the SelectingEventArgs instance cannot be null.", "arguments");

            this.startRowIndex = arguments.StartRowIndex;
            this.maximumRows = arguments.MaximumRows;

            if (parameters != null && parameters.Count > 0)
            {
                this.parameters.AddRange(parameters.Keys.Cast<string>().Select<string, ISourceParameter>(n => new SourceParameter(n, parameters[n])));
            }
        }
开发者ID:TheHunter,项目名称:DataSourceExtender,代码行数:20,代码来源:SelectingEventArgs.cs


示例15: ExecuteSelect

 protected internal override IEnumerable ExecuteSelect(DataSourceSelectArguments arguments)
 {
     arguments.RaiseUnsupportedCapabilitiesError(this);
     XmlNode xmlDocument = this._owner.GetXmlDocument();
     XmlNodeList nodes = null;
     if (this._owner.XPath.Length != 0)
     {
         nodes = xmlDocument.SelectNodes(this._owner.XPath);
     }
     else
     {
         nodes = xmlDocument.SelectNodes("/node()/node()");
     }
     return new XmlDataSourceNodeDescriptorEnumeration(nodes);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:XmlDataSourceView.cs


示例16: ExecuteSelect

        protected override IEnumerable ExecuteSelect(DataSourceSelectArguments arguments)
        {
            arguments.RaiseUnsupportedCapabilitiesError(this);

            DataTable dt = _owner.GetDataTable();
            if(dt == null) return new DataTable().DefaultView;

            _dataView = new DataView(dt);

            PerformFiltering();

            PerformSorting(arguments.SortExpression);

            return _dataView;
        }
开发者ID:anddudek,项目名称:anjlab.fx,代码行数:15,代码来源:DataTableSourceView.cs


示例17: LinqDataSourceSelectEventArgs

		public LinqDataSourceSelectEventArgs (
			DataSourceSelectArguments arguments,
			IDictionary<string, object> whereParameters,
			IOrderedDictionary orderByParameters,
			IDictionary<string, object> groupByParameters,
			IDictionary<string, object> orderGroupsByParameters,
			IDictionary<string, object> selectParameters)
		{
			// all nullable.
			Arguments = arguments;
			WhereParameters = whereParameters;
			OrderByParameters = orderByParameters;
			GroupByParameters = groupByParameters;
			OrderGroupsByParameters = orderGroupsByParameters;
			SelectParameters = selectParameters;
		}
开发者ID:nobled,项目名称:mono,代码行数:16,代码来源:LinqDataSourceSelectEventArgs.cs


示例18: ExecuteSelect

        protected override IEnumerable ExecuteSelect(DataSourceSelectArguments arguments)
        {
            var loadedEntities =  base.ExecuteSelect(arguments);

            if (!this._dataSource.GenerateEmptyRowOnTop)
            {
                return loadedEntities;
            }

            if (arguments.MaximumRows > 0)
            {
                throw new InvalidOperationException("GenerateEmptyRowOnTop is not supported together with paging!");
            }

            return Yield(Activator.CreateInstance(this.EntityType), loadedEntities);
        }
开发者ID:LCHarold,项目名称:linq2dynamodb,代码行数:16,代码来源:DynamoDbDataSourceView.cs


示例19: GetParametersForSelect

		private object[] GetParametersForSelect(DataSourceSelectArguments arguments)
		{
			var parameters = new List<object>();
			foreach (DictionaryEntry entry in SelectParameters.GetValues(HttpContext.Current, owner))
			{
				parameters.Add(entry.Value);
			}
			if (CanPage)
			{
				parameters.Add(arguments.MaximumRows);
				parameters.Add(arguments.StartRowIndex);
			}
			if ((!string.IsNullOrEmpty(arguments.SortExpression)) && (!InternalSort))
			{
				parameters.Add(arguments.SortExpression);
			}
			return parameters.ToArray();
		}
开发者ID:TargetProcess,项目名称:Tp.HelpDesk,代码行数:18,代码来源:TpObjectDataSourceView.cs


示例20: ExecuteSelect

        /// <devdoc>
        /// Returns all the rows of the datasource.
        /// </devdoc>
        protected internal override IEnumerable ExecuteSelect(DataSourceSelectArguments arguments) {
            arguments.RaiseUnsupportedCapabilitiesError(this);


            XmlNode root = _owner.GetXmlDocument();

            XmlNodeList nodes = null;
            if (_owner.XPath.Length != 0) {
                // If an XPath is specified on the control, use it
                nodes = root.SelectNodes(_owner.XPath);
            }
            else {
                // Otherwise, get all the children of the root
                nodes = root.SelectNodes("/node()/node()");
            }

            return new XmlDataSourceNodeDescriptorEnumeration(nodes);
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:21,代码来源:XmlDataSourceView.cs



注:本文中的System.Web.UI.DataSourceSelectArguments类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UI.HtmlTextWriter类代码示例发布时间:2022-05-26
下一篇:
C# UI.ControlCollection类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap