本文整理汇总了C#中Poker.TrackState方法的典型用法代码示例。如果您正苦于以下问题:C# Poker.TrackState方法的具体用法?C# Poker.TrackState怎么用?C# Poker.TrackState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Poker
的用法示例。
在下文中一共展示了Poker.TrackState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Label_ViewState
public void Label_ViewState ()
{
Poker p = new Poker ();
p.TrackState ();
Assert.AreEqual (p.Text, "", "A1");
p.Text = "Hello";
Assert.AreEqual (p.Text, "Hello", "A2");
object state = p.SaveState ();
Poker copy = new Poker ();
copy.TrackState ();
copy.LoadState (state);
Assert.AreEqual (copy.Text, "Hello", "A3");
}
示例2: ValidationRender
public void ValidationRender ()
{
/* test to show that the validation settings
* have no effect on downlevel rendering */
Poker t = new Poker ();
t.TrackState();
t.ValidationGroup = "VG";
t.CausesValidation = true;
t.TextMode = TextBoxMode.MultiLine;
string exp = "<textarea rows=\"2\" cols=\"20\"></textarea>";
HtmlDiff.AssertAreEqual (exp, t.Render (),"ValidationRender");
}
示例3: ViewState
public void ViewState ()
{
Poker t = new Poker ();
t.TrackState();
t.ValidationGroup = "VG";
t.CausesValidation = true;
object s = t.SaveState ();
Console.WriteLine ("state = {0}", s == null ? "null" : "not-null");
Poker copy = new Poker ();
copy.LoadState (s);
Assert.AreEqual ("VG", copy.ValidationGroup, "A1");
Assert.IsTrue (copy.CausesValidation, "A2");
}
示例4: TestValidationGroup
public void TestValidationGroup ()
{
Poker p = new Poker ();
p.TrackState ();
Assert.AreEqual (p.ValidationGroup, "", "V1");
p.ValidationGroup = "VG1";
Assert.AreEqual (p.ValidationGroup, "VG1", "V2");
object state = p.SaveState ();
Poker copy = new Poker ();
copy.TrackState ();
copy.LoadState (state);
Assert.AreEqual (copy.ValidationGroup, "VG1", "A3");
}