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


C# ObjectDataSourcePoker.DoRaiseDataSourceChangedEvent方法代码示例

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


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

示例1: ObjectDataSource_DataSourceChanged

		public void ObjectDataSource_DataSourceChanged ()
		{
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods, "");
			((IDataSource) ods).DataSourceChanged += new EventHandler (ObjectDataSourceTest_DataSourceChanged);
			
			// Check if event raised
			ods.DoRaiseDataSourceChangedEvent ();
			Assert.IsTrue (eventChecker, "DataSourceChanged#1");

			eventChecker = false;
			ods.ConflictDetection = ConflictOptions.CompareAllValues;
			Assert.IsFalse (eventChecker, "DataSourceChanged#2");

			eventChecker = false;
			ods.DataObjectTypeName = "MyData";
			Assert.IsFalse (eventChecker, "DataSourceChanged#3");

			eventChecker = false;
			ods.EnablePaging = true;
			Assert.IsFalse (eventChecker, "DataSourceChanged#4");

			eventChecker = false;
			ods.FilterExpression = "ID='{0}'";
			Assert.IsFalse (eventChecker, "DataSourceChanged#5");


			eventChecker = false;
			TextBox TextBox1 = new TextBox ();
			TextBox1.Text = "1001";
			FormParameter p = new FormParameter ("ID", "TextBox1");
			p.DefaultValue = "1002";
			ods.FilterParameters.Add (p);
			Assert.IsFalse (eventChecker, "DataSourceChanged#6");

			eventChecker = false;
			ods.MaximumRowsParameterName = "SelectCount";
			Assert.IsFalse (eventChecker, "DataSourceChanged#7");

			eventChecker = false;
			ods.OldValuesParameterFormatString = "ID";
			Assert.IsFalse (eventChecker, "DataSourceChanged#8");

			eventChecker = false;
			Parameter dummy = new Parameter ();
			dummy.Name = "Test";
			ods.SelectParameters.Add (dummy);
			Assert.IsFalse (eventChecker, "DataSourceChanged#9");

			eventChecker = false;
			ods.SortParameterName = "sortExpression";
			Assert.IsFalse (eventChecker, "DataSourceChanged#10");

			eventChecker = false;
			ods.StartRowIndexParameterName = "ID";
			Assert.IsFalse (eventChecker, "DataSourceChanged#11");

			eventChecker = false; 
			ods.CacheDuration = 1000;
			Assert.IsFalse (eventChecker, "DataSourceChanged#12");

			eventChecker = false;
			ods.CacheExpirationPolicy = DataSourceCacheExpiry.Sliding;
			Assert.IsFalse (eventChecker, "DataSourceChanged#13");

			eventChecker = false;
			ods.CacheKeyDependency = "ID";
			Assert.IsFalse (eventChecker, "DataSourceChanged#14");

			eventChecker = false;
			ods.ConvertNullToDBNull = true;
			Assert.IsFalse (eventChecker, "DataSourceChanged#15");

			eventChecker = false;
			ods.EnableCaching = true;
			Assert.IsFalse (eventChecker, "DataSourceChanged#16");

			eventChecker = false;
			ods.SqlCacheDependency = "Northwind:Employees";
			Assert.IsFalse (eventChecker, "DataSourceChanged#17");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:81,代码来源:ObjectDataSourceTest.cs


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