本文整理汇总了C#中Poker.DoOnBubbleEvent方法的典型用法代码示例。如果您正苦于以下问题:C# Poker.DoOnBubbleEvent方法的具体用法?C# Poker.DoOnBubbleEvent怎么用?C# Poker.DoOnBubbleEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Poker
的用法示例。
在下文中一共展示了Poker.DoOnBubbleEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PageIndex
[Category ("NotDotNet")] //TODO
public void PageIndex ()
{
ObjectDataSource ds = new ObjectDataSource ();
ds.ID = "ObjectDataSource1";
ds.TypeName = "System.Guid";
ds.SelectMethod = "ToByteArray";
Page p = new Page ();
Poker f = new Poker ();
f.Page = p;
ds.Page = p;
p.Controls.Add (f);
p.Controls.Add (ds);
f.DataSourceID = "ObjectDataSource1";
f.DoConfirmInitState ();
f.DoOnPreRender (EventArgs.Empty);
object cur = f.DataItem;
f.PageIndex = 1;
Assert.IsTrue (cur != f.DataItem, "#01");
CommandEventArgs cargs = new CommandEventArgs ("Page", "Prev");
FormViewCommandEventArgs fvargs = new FormViewCommandEventArgs (f, cargs);
f.DoOnBubbleEvent (f, fvargs);
Assert.IsTrue (f.OnPageIndexChangingCalled, "#02");
Assert.IsTrue (f.OnPageIndexChangedCalled, "#03");
f.OnPageIndexChangingCalled = false;
f.OnPageIndexChangedCalled = false;
f.DoOnBubbleEvent (f, fvargs);
Assert.IsTrue (f.OnPageIndexChangingCalled, "#04");
Assert.IsFalse (f.OnPageIndexChangedCalled, "#05");
f.OnPageIndexChangingCalled = false;
f.OnPageIndexChangedCalled = false;
f.PageIndex = f.PageCount - 1;
cargs = new CommandEventArgs ("Page", "Next");
fvargs = new FormViewCommandEventArgs (f, cargs);
f.DoOnBubbleEvent (f, fvargs);
Assert.IsTrue (f.OnPageIndexChangingCalled, "#06");
Assert.IsFalse (f.OnPageIndexChangedCalled, "#07");
f.OnPageIndexChangingCalled = false;
f.OnPageIndexChangedCalled = false;
}
示例2: FormView_BubbleEvent
public void FormView_BubbleEvent ()
{
FormViewCommandEventArgs com;
Poker fv = new Poker ();
Page page = new Page ();
Button bt = new Button ();
fv.AllowPaging = true;
fv.DataSource = myds;
page.Controls.Add (fv);
fv.DataBind ();
ResetEvents ();
fv.ItemCommand += new FormViewCommandEventHandler (fv_ItemCommand);
fv.ItemDeleted += new FormViewDeletedEventHandler (fv_ItemDeleted);
//Delete
fv.ItemDeleting += new FormViewDeleteEventHandler (fv_ItemDeleting);
com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Delete", null));
Assert.AreEqual (false, itemDeleting, "BeforeDeleteCommandBubbleEvent");
Assert.AreEqual (false, itemCommand, "BeforeDeleteBubbleEvent");
Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Delete");
Assert.AreEqual (true, itemDeleting, "AfterDeleteBubbleEvent");
Assert.AreEqual (true, itemCommand, "AfterDeleteCommandBubbleEvent");
//Insert
itemCommand = false;
fv.ItemInserting += new FormViewInsertEventHandler (fv_ItemInserting);
fv.ChangeMode (FormViewMode.Insert);
com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Insert", null));
Assert.AreEqual (false, itemCommand, "BeforeInsertCommandBubbleEvent");
Assert.AreEqual (false, itemInserting, "BeforeInsertBubbleEvent");
Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Insert");
Assert.AreEqual (true, itemCommand, "AfterInsertCommandBubbleEvent");
Assert.AreEqual (true, itemInserting, "AfterInsertBubbleEvent");
//Update
itemCommand = false;
fv.ItemUpdating += new FormViewUpdateEventHandler (fv_ItemUpdating);
fv.ChangeMode (FormViewMode.Edit);
com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Update", null));
Assert.AreEqual (false, itemUpdating, "BeforeUpdateEvent");
Assert.AreEqual (false, itemCommand, "BeforeUpdateCommandEvent");
Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Update");
Assert.AreEqual (true, itemCommand, "AfterUpdateCommandBubbleEvent");
Assert.AreEqual (true, itemUpdating, "AfterUpdateBubbleEvent");
//Cancel
itemCommand = false;
fv.ModeChanging += new FormViewModeEventHandler (fv_ModeChanging);
com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Cancel", null));
Assert.AreEqual (false, itemCommand, "BeforeCancelCommandBubbleEvent");
Assert.AreEqual (false, modeChanging, "BeforeCancelBubbleEvent");
Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Cancel");
Assert.AreEqual (true, itemCommand, "AfterCancelCommandBubbleEvent");
Assert.AreEqual (true, modeChanging, "AfterCancelBubbleEvent");
//Edit
itemCommand = false;
modeChanging = false;
com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Edit", null));
Assert.AreEqual (false, itemCommand, "BeforeEditCommandBubbleEvent");
Assert.AreEqual (false, modeChanging, "BeforeEditBubbleEvent");
Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Edit");
Assert.AreEqual (true, itemCommand, "AfterEditCommandBubbleEvent");
Assert.AreEqual (true, modeChanging, "AfterEditBubbleEvent");
//New
itemCommand = false;
modeChanging = false;
com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("New", null));
Assert.AreEqual (false, itemCommand, "BeforeNewCommandBubbleEvent");
Assert.AreEqual (false, modeChanging, "BeforeNewBubbleEvent");
Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - New");
Assert.AreEqual (true, itemCommand, "AfterNewCommandBubbleEvent");
Assert.AreEqual (true, modeChanging, "AfterNewBubbleEvent");
//Page Index default
itemCommand = false;
fv.PageIndexChanging += new FormViewPageEventHandler (fv_PageIndexChanging);
com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Page", null));
Assert.AreEqual (false, itemCommand, "BeforePageCommandBubbleEvent");
Assert.AreEqual (false, pageIndexChanging, "BeforePageBubbleEvent");
Assert.IsTrue (fv.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 FormViewCommandEventArgs (bt, new CommandEventArgs ("Page", "Next"));
Assert.AreEqual (false, itemCommand, "BeforeNextPageCommandBubbleEvent");
Assert.AreEqual (false, pageIndexChanging, "BeforeNextPageBubbleEvent");
Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Next Page");
Assert.AreEqual (true, itemCommand, "AfterNextPageCommandBubbleEvent");
Assert.AreEqual (true, pageIndexChanging, "AfterNextPageBubbleEvent");
Assert.AreEqual (1, newPageIndex, "NextPageIndex");
//Prev Page
//.........这里部分代码省略.........