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


C# PokerDetailsView.DoSaveControlState方法代码示例

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


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

示例1: DetailsView_DataKey

		public void DetailsView_DataKey () {
			Page p = new Page ();

			PokerDetailsView fv = new PokerDetailsView ();
			p.Controls.Add (fv);

			ObjectDataSource data = new ObjectDataSource ();
			data.TypeName = typeof (TableObject).AssemblyQualifiedName;
			data.SelectMethod = "GetMyData";
			p.Controls.Add (data);

			fv.DataSource = data;
			fv.DataKeyNames = new string [] { "ID", "FName" };

			DataKey key1 = fv.DataKey;

			Assert.AreEqual (null, key1.Value, "DataKey.Value before binding");
			Assert.AreEqual (0, key1.Values.Count, "DataKey.Values count before binding");

			fv.DataBind ();

			DataKey key2 = fv.DataKey;
			DataKey key3 = fv.DataKey;

			Assert.IsFalse (Object.ReferenceEquals (key1, key2), "DataKey returns the same instans");
			Assert.IsTrue (Object.ReferenceEquals (key2, key3), "DataKey returns the same instans");

			Assert.AreEqual (1001, key1.Value, "DataKey.Value after binding");
			Assert.AreEqual (2, key1.Values.Count, "DataKey.Values count after binding");
			Assert.AreEqual (1001, key1.Values [0], "DataKey.Values[0] after binding");
			Assert.AreEqual ("Mahesh", key1.Values [1], "DataKey.Values[1] after binding");

			PokerDetailsView copy = new PokerDetailsView ();
			object state = fv.DoSaveControlState ();
			copy.DoLoadControlState (state);

			DataKey key4 = copy.DataKey;

			Assert.AreEqual (1001, key4.Value, "DataKey.Value from ControlState");
			Assert.AreEqual (2, key4.Values.Count, "DataKey.Values count from ControlState");
			Assert.AreEqual (1001, key4.Values [0], "DataKey.Values[0] from ControlState");
			Assert.AreEqual ("Mahesh", key4.Values [1], "DataKey.Values[1] from ControlState");
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:43,代码来源:DetailsViewTest.cs

示例2: DetailsView_ControlState

		public void DetailsView_ControlState ()
		{
			PokerDetailsView dv = new PokerDetailsView ();
			PokerDetailsView copy = new PokerDetailsView ();
			string[] keys = new String[2];
			keys[0] = "key1";
			keys[1] = "key2";
			dv.DataKeyNames = keys;
			dv.BackImageUrl = "photo.jpg";
			dv.DefaultMode = DetailsViewMode.Insert;
			object state = dv.DoSaveControlState ();
			copy.DoLoadControlState (state);
			Assert.AreEqual ("key1", copy.DataKeyNames[0], "ControlStateDataKeyValue");
			Assert.AreEqual ("key2", copy.DataKeyNames[1], "ControlStateDataKeyValue2");
			Assert.AreEqual (DetailsViewMode.Insert, copy.DefaultMode, "ControlStateDefaultMode");

		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:17,代码来源:DetailsViewTest.cs


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