当前位置: 首页>>代码示例>>C#>>正文


C# PokerDetailsView.DoOnBubbleEvent方法代码示例

本文整理汇总了C#中PokerDetailsView.DoOnBubbleEvent方法的典型用法代码示例。如果您正苦于以下问题:C# PokerDetailsView.DoOnBubbleEvent方法的具体用法?C# PokerDetailsView.DoOnBubbleEvent怎么用?C# PokerDetailsView.DoOnBubbleEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PokerDetailsView的用法示例。


在下文中一共展示了PokerDetailsView.DoOnBubbleEvent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DetailsView_BubbleEvents

		public void DetailsView_BubbleEvents ()
		{
			ResetEvents ();
			DetailsViewCommandEventArgs com;
			PokerDetailsView dv = new PokerDetailsView ();
			dv.DataSource = TableObject.CreateDataTable ();
			Page page = new Page ();
			Button bt = new Button ();
			dv.AllowPaging = true;
			dv.DataSource = myds;
			page.Controls.Add (dv);		
			dv.DataBind ();
			dv.ItemCommand += new DetailsViewCommandEventHandler (dv_ItemCommand );
			dv.ItemDeleted += new DetailsViewDeletedEventHandler (dv_ItemDeleted );
			//Delete
			dv.ItemDeleting += new DetailsViewDeleteEventHandler (dv_ItemDeleting );
			com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Delete", null));
			Assert.AreEqual (false, itemCommand, "BeforeDeleteCommandBubbleEvent");
			Assert.AreEqual (false, itemDeleting, "BeforeDeleteBubbleEvent");			
			Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Delete");
			Assert.AreEqual (true, itemDeleting, "AfterDeleteBubbleEvent");			
			Assert.AreEqual (true, itemCommand, "AfterDeleteCommandBubbleEvent");

			//Insert
			itemCommand = false;
			dv.ItemInserting += new DetailsViewInsertEventHandler (dv_ItemInserting);
			dv.ChangeMode (DetailsViewMode.Insert);
			com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Insert", null));
			Assert.AreEqual (false, itemCommand, "BeforeInsertCommandBubbleEvent");
			Assert.AreEqual (false, itemInserting, "BeforeInsertBubbleEvent");
			Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Insert");
			Assert.AreEqual (true, itemCommand, "AfterInsertCommandBubbleEvent");
			Assert.AreEqual (true, itemInserting, "AfterInsertBubbleEvent");

			//Update
			itemCommand = false;
			dv.ItemUpdating += new DetailsViewUpdateEventHandler (dv_ItemUpdating);
			dv.ChangeMode (DetailsViewMode.Edit);
			com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Update", null));
			Assert.AreEqual (false, itemUpdating, "BeforeUpdateEvent");
			Assert.AreEqual (false, itemCommand, "BeforeUpdateCommandEvent");
			Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Update");
			Assert.AreEqual (true, itemCommand, "AfterUpdateCommandBubbleEvent");
			Assert.AreEqual (true, itemUpdating, "AfterUpdateBubbleEvent");

			//Cancel 
			itemCommand = false;
			dv.ModeChanging += new DetailsViewModeEventHandler (dv_ModeChanging);
			com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Cancel", null));
			Assert.AreEqual (false, itemCommand, "BeforeCancelCommandBubbleEvent");
			Assert.AreEqual (false, modeChanging, "BeforeCancelBubbleEvent");
			Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Cancel");
			Assert.AreEqual (true, itemCommand, "AfterCancelCommandBubbleEvent");
			Assert.AreEqual (true, modeChanging, "AfterCancelBubbleEvent");

			//Edit
			itemCommand = false;
			modeChanging = false;
			com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Edit", null));
			Assert.AreEqual (false, itemCommand, "BeforeEditCommandBubbleEvent");
			Assert.AreEqual (false, modeChanging, "BeforeEditBubbleEvent");
			Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Edit");
			Assert.AreEqual (true, itemCommand, "AfterEditCommandBubbleEvent");
			Assert.AreEqual (true, modeChanging, "AfterEditBubbleEvent");

			//New
			itemCommand = false;
			modeChanging = false;
			com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("New", null));
			Assert.AreEqual (false, itemCommand, "BeforeNewCommandBubbleEvent");
			Assert.AreEqual (false, modeChanging, "BeforeNewBubbleEvent");
			Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - New");
			Assert.AreEqual (true, itemCommand, "AfterNewCommandBubbleEvent");
			Assert.AreEqual (true, modeChanging, "AfterNewBubbleEvent");

			//Page Index default
			itemCommand = false;
			dv.PageIndexChanging += new DetailsViewPageEventHandler (dv_PageIndexChanging );
			com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Page", null));
			Assert.AreEqual (false, itemCommand, "BeforePageCommandBubbleEvent");
			Assert.AreEqual (false, pageIndexChanging, "BeforePageBubbleEvent");
			Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Page Index default");
			Assert.AreEqual (true, itemCommand, "AfterPageCommandBubbleEvent");
			Assert.AreEqual (true, pageIndexChanging, "AfterPageBubbleEvent");
			Assert.AreEqual (-1, newPageIndex, "PageIndex");

			//Next Page
			itemCommand = false;
			pageIndexChanging = false;
			com = new DetailsViewCommandEventArgs (bt, new CommandEventArgs ("Page", "Next"));
			Assert.AreEqual (false, itemCommand, "BeforeNextPageCommandBubbleEvent");
			Assert.AreEqual (false, pageIndexChanging, "BeforeNextPageBubbleEvent");
			Assert.IsTrue (dv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Next Page");
			Assert.AreEqual (true, itemCommand, "AfterNextPageCommandBubbleEvent");
			Assert.AreEqual (true, pageIndexChanging, "AfterNextPageBubbleEvent");
			Assert.AreEqual (1, newPageIndex, "NextPageIndex");

			//Prev Page
			itemCommand = false;
			pageIndexChanging = false;
//.........这里部分代码省略.........
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:101,代码来源:DetailsViewTest.cs


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