本文整理汇总了C#中PokerDetailsView.DoCreateDataSourceSelectArguments方法的典型用法代码示例。如果您正苦于以下问题:C# PokerDetailsView.DoCreateDataSourceSelectArguments方法的具体用法?C# PokerDetailsView.DoCreateDataSourceSelectArguments怎么用?C# PokerDetailsView.DoCreateDataSourceSelectArguments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PokerDetailsView
的用法示例。
在下文中一共展示了PokerDetailsView.DoCreateDataSourceSelectArguments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DetailsView_CreateDataSourceSelectArguments
public void DetailsView_CreateDataSourceSelectArguments () {
DataSourceView view;
Page p = new Page ();
PokerDetailsView dv = new PokerDetailsView ();
p.Controls.Add (dv);
ObjectDataSource data = new ObjectDataSource ();
data.TypeName = typeof (DataSourceObject).AssemblyQualifiedName;
data.SelectMethod = "GetList";
data.SortParameterName = "sortExpression";
DataSourceSelectArguments arg;
p.Controls.Add (data);
dv.DataSource = data;
dv.DataBind ();
arg = dv.DoCreateDataSourceSelectArguments ();
Assert.IsTrue (arg.Equals (DataSourceSelectArguments.Empty), "Default");
dv.AllowPaging = true;
dv.PageIndex = 2;
arg = dv.DoCreateDataSourceSelectArguments ();
view = dv.DoGetData ();
Assert.IsFalse (view.CanPage);
Assert.IsTrue (view.CanRetrieveTotalRowCount);
Assert.IsTrue (arg.Equals (DataSourceSelectArguments.Empty), "AllowPaging = true, CanPage = false, CanRetrieveTotalRowCount = true");
// make DataSourceView.CanPage = true
data.EnablePaging = true;
arg = dv.DoCreateDataSourceSelectArguments ();
view = dv.DoGetData ();
Assert.IsTrue (view.CanPage);
Assert.IsFalse (view.CanRetrieveTotalRowCount);
Assert.IsTrue (arg.Equals (new DataSourceSelectArguments (2, -1)), "AllowPaging = true, CanPage = true, CanRetrieveTotalRowCount = false");
dv.AllowPaging = false;
arg = dv.DoCreateDataSourceSelectArguments ();
Assert.IsTrue (arg.Equals (DataSourceSelectArguments.Empty), "AllowPaging = false, CanPage = true, CanRetrieveTotalRowCount = false");
// make DataSourceView.CanRetrieveTotalRowCount = true
data.SelectCountMethod = "GetCount";
arg = dv.DoCreateDataSourceSelectArguments ();
Assert.IsTrue (arg.Equals (DataSourceSelectArguments.Empty), "AllowPaging = false, CanPage = true, CanRetrieveTotalRowCount = true");
dv.AllowPaging = true;
arg = dv.DoCreateDataSourceSelectArguments ();
DataSourceSelectArguments arg1 = new DataSourceSelectArguments (2, 1);
arg1.RetrieveTotalRowCount = true;
view = dv.DoGetData ();
Assert.IsTrue (view.CanPage);
Assert.IsTrue (view.CanRetrieveTotalRowCount);
Assert.IsTrue (arg.Equals (arg1), "AllowPaging = true, CanPage = true, CanRetrieveTotalRowCount = true");
}