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


C# PokerDetailsView类代码示例

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


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

示例1: DetailsView_ViewState

		public void DetailsView_ViewState ()
		{
			PokerDetailsView dv = new PokerDetailsView ();
			PokerDetailsView copy = new PokerDetailsView ();
			dv.HeaderText = "Header";
			dv.GridLines = GridLines.Vertical;
			dv.CssClass = "style.css";
			object state = dv.SaveState ();
			copy.LoadState (state);
			Assert.AreEqual ("Header", copy.HeaderText, "ViewStateHeaderText");
			Assert.AreEqual (GridLines.Vertical, copy.GridLines, "ViewStateGridLines");
			Assert.AreEqual ("style.css", copy.CssClass, "ViewStateCssClass");
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:13,代码来源:DetailsViewTest.cs

示例2: DetailsView_UpdateItem

		public void DetailsView_UpdateItem ()
		{
			PokerDetailsView dv = new PokerDetailsView ();
			dv.ChangeMode (DetailsViewMode.Edit);
			dv.Page = new Page ();
			dv.Page.Validate ();
			dv.ItemUpdating += new DetailsViewUpdateEventHandler (update_item);
			Assert.AreEqual (false, updateItem, "BeforeUpdateItem");
			dv.UpdateItem (true);
			Assert.AreEqual (true, updateItem, "AfterUpdateItem");

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

示例3: DetailsView_CreateAutoGenerateRow

		public void DetailsView_CreateAutoGenerateRow ()
		{
			PokerDetailsView dv = new PokerDetailsView ();			
			AutoGeneratedFieldProperties prop = new AutoGeneratedFieldProperties ();			
			prop.Name = "FieldItem";			
			prop.Type = typeof(String);
			AutoGeneratedField field = dv.DoCreateAutoGeneratedRow (prop);
			Assert.AreEqual (typeof (string), field.DataType, "FieldDataType");
			Assert.AreEqual ("FieldItem", field.HeaderText, "FieldHeaderText");
			Assert.AreEqual ("FieldItem",field.SortExpression ,"FieldSortExpretion");
			Assert.AreEqual (typeof(AutoGeneratedField), field.GetType (), "AutoGeneratedFieldType"); 

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

示例4: FormView_IsBindableType

		public void FormView_IsBindableType ()
		{
			bool isBindable = false;
			PokerDetailsView dv = new PokerDetailsView ();
			isBindable = dv.IsBindableType (typeof (Decimal));
			Assert.AreEqual (true, isBindable, "IsBindableTypeDecimal");
			isBindable = dv.IsBindableType (typeof (Int32));
			Assert.AreEqual (true, isBindable, "IsBindableTypeInt32");
			isBindable = dv.IsBindableType (typeof (String));
			Assert.AreEqual (true, isBindable, "IsBindableTypeString");
			isBindable = dv.IsBindableType (typeof (Boolean));
			Assert.AreEqual (true, isBindable, "IsBindableTypeBoolean");
			isBindable = dv.IsBindableType (typeof (DateTime));
			Assert.AreEqual (true, isBindable, "IsBindableTypeDateTime");
			isBindable = dv.IsBindableType (typeof (Byte));
			Assert.AreEqual (true, isBindable, "IsBindableTypeByte");
			isBindable = dv.IsBindableType (typeof (Guid));
			Assert.AreEqual (true, isBindable, "IsBindableTypeGuid");
			isBindable = dv.IsBindableType (typeof (DTemplate));
			Assert.AreEqual (false, isBindable, "IsBindableTypeMyTemplate");
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:21,代码来源:DetailsViewTest.cs

示例5: DetailsView_DeleteItem

		public static void DetailsView_DeleteItem (Page p)
		{
			LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG);
			LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG);
			PokerDetailsView dv = new PokerDetailsView ();
			ObjectDataSource ds = new ObjectDataSource ();
			ds.ID = "ObjectDataSource1";
			ds.TypeName = "MonoTests.System.Web.UI.WebControls.TableObject";
			ds.SelectMethod = "GetMyData";
			ds.DeleteMethod = "Delete";
			ds.InsertMethod = "Insert";
			ds.UpdateMethod = "Update";
			Parameter p1 = new Parameter ("ID", TypeCode.String);
			Parameter p2 = new Parameter ("FName", TypeCode.String);
			Parameter p3 = new Parameter ("LName", TypeCode.String);
			ds.DeleteParameters.Add (p1);
			ds.DeleteParameters.Add (p2);
			ds.DeleteParameters.Add (p3);
			dv.Page = p;
			ds.Page = p;
			p.Form.Controls.Add (lcb);
			p.Form.Controls.Add (dv);
			p.Form.Controls.Add (ds);
			p.Form.Controls.Add (lce);
			dv.AllowPaging = true;
			dv.DataKeyNames = new string[] { "ID", "FName", "LName" };
			dv.DataSourceID = "ObjectDataSource1";
			dv.DataBind ();
			dv.DeleteItem ();
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:30,代码来源:DetailsViewTest.cs

示例6: DetailsView_EmptyContentRendering_Load

		public static void DetailsView_EmptyContentRendering_Load(Page p)
		{
			LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG);
			LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG);

			PokerDetailsView dv = new PokerDetailsView ();
			dv.DataSource = new ArrayList ();
			dv.HeaderText = "Header Text";
			dv.FooterText = "Footer Text";
			LinkButton lb = new LinkButton ();
			lb.ID = "LinkButton1";
			lb.Text = "Test";
			
			p.Form.Controls.Add (lcb);
			p.Form.Controls.Add (dv);
			dv.DataBind ();
			p.Form.Controls.Add (lb);
			p.Form.Controls.Add (lce);		
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:19,代码来源:DetailsViewTest.cs

示例7: DetailsView_ChangeMode

		public void DetailsView_ChangeMode ()
		{
			PokerDetailsView dv = new PokerDetailsView ();
			Assert.AreEqual (DetailsViewMode.ReadOnly, dv.CurrentMode, "ChangeModeDefault");
			dv.ChangeMode (DetailsViewMode.Insert);
			Assert.AreEqual (DetailsViewMode.Insert, dv.CurrentMode, "ChangeModeInsert");
			dv.ChangeMode (DetailsViewMode.Edit);
			Assert.AreEqual (DetailsViewMode.Edit, dv.CurrentMode, "ChangeModeEdit");
			dv.ChangeMode (DetailsViewMode.ReadOnly);
			Assert.AreEqual (DetailsViewMode.ReadOnly, dv.CurrentMode, "ChangeModeReadOnly");
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:11,代码来源:DetailsViewTest.cs

示例8: CellSpacingException

		public void CellSpacingException ()
		{
			PokerDetailsView dv = new PokerDetailsView ();
			dv.CellSpacing = -5;
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:5,代码来源:DetailsViewTest.cs

示例9: PageIndexException

		public void PageIndexException ()
		{
			PokerDetailsView dv = new PokerDetailsView ();
			dv.PageIndex = -5;
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:5,代码来源:DetailsViewTest.cs

示例10: DetailsView_Events

		public void DetailsView_Events ()
		{
			ResetEvents ();
			PokerDetailsView dv = new PokerDetailsView ();
			Button bt = new Button ();
			Page pg = new Page ();
			dv.Page = pg;
			dv.Init += new EventHandler (dv_Init);
			dv.ItemCommand += new DetailsViewCommandEventHandler (dv_ItemCommand);
			dv.ItemCreated += new EventHandler (dv_ItemCreated);
			dv.ItemDeleted += new DetailsViewDeletedEventHandler (dv_ItemDeleted);
			dv.ItemDeleting += new DetailsViewDeleteEventHandler (dv_ItemDeleting);
			dv.ItemInserted += new DetailsViewInsertedEventHandler (dv_ItemInserted);
			dv.ItemInserting += new DetailsViewInsertEventHandler (dv_ItemInserting);
			dv.ItemUpdated += new DetailsViewUpdatedEventHandler (dv_ItemUpdated);
			dv.ItemUpdating += new DetailsViewUpdateEventHandler (dv_ItemUpdating);
			dv.ModeChanged += new EventHandler (dv_ModeChanged);
			dv.ModeChanging += new DetailsViewModeEventHandler (dv_ModeChanging);
			dv.PageIndexChanged += new EventHandler (dv_PageIndexChanged);
			dv.PageIndexChanging += new DetailsViewPageEventHandler (dv_PageIndexChanging);
			dv.DataBound += new EventHandler (dv_DataBound);
			dv.PreRender += new EventHandler (dv_PreRender);
			dv.Unload += new EventHandler (dv_Unload);			
			Assert.AreEqual (false, init, "BeforeInit");
			dv.DoOnInit (new EventArgs ());
			Assert.AreEqual (true, init, "AfterInit");
			Assert.AreEqual (false, itemCommand, "BeforeItemCommand");
			dv.DoOnItemCommand (new DetailsViewCommandEventArgs (bt,new CommandEventArgs ("",null)));
			Assert.AreEqual (true, itemCommand , "AfterItemCommand");
			Assert.AreEqual (false, itemCreated, "BeforeItemCreated");
			dv.DoOnItemCreated (new EventArgs ());
			Assert.AreEqual (true, itemCreated, "AfterItemCreated");
			Assert.AreEqual (false, itemDeleted, "BeforeItemDeleted");
			dv.DoOnItemDeleted (new DetailsViewDeletedEventArgs (3, new Exception ()));
			Assert.AreEqual (true, itemDeleted, "AfterItemDeleted");
			Assert.AreEqual (false, itemDeleting, "BeforeItemDeleting");
			dv.DoOnItemDeleting(new DetailsViewDeleteEventArgs (2)); 
			Assert.AreEqual (true, itemDeleting, "AfterItemDeleting");
			Assert.AreEqual (false, itemInserted, "BeforeItemInserted");
			dv.DoOnItemInserted (new DetailsViewInsertedEventArgs (3,new Exception()));
			Assert.AreEqual (true, itemInserted, "AfterItemInserted");
			Assert.AreEqual (false, itemInserting, "BeforeItemInserting");
			dv.DoOnItemInserting (new DetailsViewInsertEventArgs (bt));
			Assert.AreEqual (true, itemInserting, "AfterItemInserting");
			Assert.AreEqual (false, itemUpdated, "BeforeItemUpdated");
			dv.DoOnItemUpdated (new DetailsViewUpdatedEventArgs (2,new Exception()));
			Assert.AreEqual (true, itemUpdated, "AfterItemUpdated");
			Assert.AreEqual (false, itemUpdating, "BeforeItemUpdating");
			dv.DoOnItemUpdating (new DetailsViewUpdateEventArgs (bt));
			Assert.AreEqual (true, itemUpdating, "AfterItemUpdating");
			Assert.AreEqual (false, modeChanged, "BeforeModeChanged");
			dv.DoOnModeChanged (new EventArgs ());
			Assert.AreEqual (true, modeChanged, "AfterModeChanged");
			Assert.AreEqual (false, modeChanging, "BeforeModeChanging");
			dv.DoOnModeChanging (new DetailsViewModeEventArgs (DetailsViewMode.Insert ,false));
			Assert.AreEqual (true, modeChanging, "AfterModeChanging");
			Assert.AreEqual (false, pageIndexChanged, "BeforePageIndexChanged");
			dv.DoOnPageIndexChanged (new EventArgs ());
			Assert.AreEqual (true, pageIndexChanged, "AfterPageIndexChanged");
			Assert.AreEqual (false, pageIndexChanging, "BeforePageIndexChanging");
			dv.DoOnPageIndexChanging (new DetailsViewPageEventArgs (2));
			Assert.AreEqual (true, pageIndexChanging, "AfterPageIndexChanging");
			//Assert.AreEqual (false, pagePreLoad, "BeforePagePreLoad");
			//dv.DoOnPagePreLoad (pg, new EventArgs ());
			//Assert.AreEqual (true, pagePreLoad, "AfterPagePreLoad");
			Assert.AreEqual (false, preRender, "BeforePreRender");			
			dv.DoOnPreRender(new EventArgs ());
			Assert.AreEqual (true, preRender, "AfterPreRender");
			Assert.AreEqual (false, unload, "BeforeUnload");
			dv.DoOnUnload (new EventArgs ());
			Assert.AreEqual (true, unload, "AfterUnload");
			//Assert.AreEqual (false, dataSourceViewChanged, "BeforeDataSourceViewChanged");
			//dv.DoOnDataSourceViewChanged (bt, new EventArgs ());
			//Assert.AreEqual (true, dataSourceViewChanged, "AfterDataSourceViewChanged");



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

示例11: CellPaddingException

		public void CellPaddingException ()
		{
			PokerDetailsView dv = new PokerDetailsView ();
			dv.CellPadding = -2;
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:5,代码来源:DetailsViewTest.cs

示例12: DetailsView_Init

		public static void DetailsView_Init (Page p)
		{
			PokerDetailsView dv = new PokerDetailsView ();
			DS data = new DS ();
			p.Controls.Add (dv);
			p.Controls.Add (data);
			data.TypeName = typeof (DS).AssemblyQualifiedName;
			data.SelectMethod = "GetList";
			data.ID = "Data";
			dv.DataBinding += new EventHandler (data_DataBinding);
			dv.DataSourceID = "Data";
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:12,代码来源:DetailsViewTest.cs

示例13: 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

示例14: 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

示例15: DetailsView_AssignToDefaultProperties

		public void DetailsView_AssignToDefaultProperties ()
		{
			PokerDetailsView dv = new PokerDetailsView ();
			dv.AllowPaging = true;
			dv.DataSource = myds;
			dv.DataBind ();			
			Assert.AreEqual (true, dv.AllowPaging, "AllowPaging");
			dv.AlternatingRowStyle.CssClass = "style.css";
			Assert.AreEqual ("style.css", dv.AlternatingRowStyle.CssClass, "AlternatingRowStyle");
			dv.AutoGenerateDeleteButton = true;
			Assert.AreEqual (true, dv.AutoGenerateDeleteButton, "AutoGenerateDeleteButton");
			dv.AutoGenerateEditButton = true;
			Assert.AreEqual (true, dv.AutoGenerateEditButton, "AutoGenerateEditButton");
			dv.AutoGenerateInsertButton = true;
			Assert.AreEqual (true, dv.AutoGenerateInsertButton, "AutoGenerateInsertButton");
			dv.AutoGenerateRows = false;
			Assert.AreEqual (false, dv.AutoGenerateRows, "AutoGenerateRows");
			dv.BackImageUrl = "image.jpg";
			Assert.AreEqual ("image.jpg", dv.BackImageUrl, "BackImageUrl");
			dv.Caption = "Caption Test";
			Assert.AreEqual ("Caption Test", dv.Caption, "Caption");
			dv.CaptionAlign = TableCaptionAlign.Right;
			Assert.AreEqual (TableCaptionAlign.Right, dv.CaptionAlign, "CaptionAlign");
			dv.CellPadding = 2;
			Assert.AreEqual (2, dv.CellPadding, "CellPadding");
			dv.CellSpacing = 5;
			Assert.AreEqual (5, dv.CellSpacing, "CellSpacing");
			dv.CommandRowStyle.BackColor = Color.Purple;
			Assert.AreEqual (Color.Purple, dv.CommandRowStyle.BackColor, "CommandRowStyle.BackColor");
			dv.ChangeMode (DetailsViewMode.Insert);
			Assert.AreEqual (DetailsViewMode.Insert, dv.CurrentMode, "CurrentModeInsert");
			dv.ChangeMode (DetailsViewMode.Edit );
			Assert.AreEqual (DetailsViewMode.Edit, dv.CurrentMode, "CurrentModeEdit");
			Assert.AreEqual ("Item1", dv.DataItem, "DataItem");
			Assert.AreEqual (6, dv.DataItemCount, "DataItemCount");
			Assert.AreEqual (0, dv.DataItemIndex, "DataItemIndex");
			string[] names ={ "test1", "test2", "test3" };
			dv.DataKeyNames = names;
			Assert.AreEqual (names, dv.DataKeyNames, "DataKeyNames");
			dv.DefaultMode = DetailsViewMode.Edit;
			Assert.AreEqual (DetailsViewMode.Edit, dv.DefaultMode, "DefaultModeEdit");
			dv.DefaultMode = DetailsViewMode.Insert;
			Assert.AreEqual (DetailsViewMode.Insert, dv.DefaultMode, "DefaultModeInsert");
			dv.DefaultMode = DetailsViewMode.ReadOnly;
			Assert.AreEqual (DetailsViewMode.ReadOnly, dv.DefaultMode, "DefaultModeReadOnly");
			dv.EditRowStyle.ForeColor = Color.Pink;
			Assert.AreEqual (Color.Pink, dv.EditRowStyle.ForeColor, "EditRowStyle");
			dv.EmptyDataRowStyle.HorizontalAlign = HorizontalAlign.Center;
			Assert.AreEqual (HorizontalAlign.Center, dv.EmptyDataRowStyle.HorizontalAlign, "HorizontalAlignCenter");
			dv.EmptyDataTemplate = new DTemplate ();
			Assert.AreEqual (typeof (DTemplate), dv.EmptyDataTemplate.GetType() , "EmptyDataTemplate");
			dv.EmptyDataText = "No Data";
			Assert.AreEqual ("No Data", dv.EmptyDataText, "EmptyDataText");
			dv.EnablePagingCallbacks = true;
			Assert.AreEqual (true, dv.EnablePagingCallbacks, "EnablePagingCallbacks");
			dv.FieldHeaderStyle.CssClass = "style.css";
			Assert.AreEqual ("style.css", dv.FieldHeaderStyle.CssClass, "FieldHeaderStyle");
			DataControlFieldCollection coll=new DataControlFieldCollection ();
			dv.FooterStyle.HorizontalAlign = HorizontalAlign.Right ;
			Assert.AreEqual (HorizontalAlign.Right, dv.FooterStyle.HorizontalAlign , "FooterStyle");
			dv.FooterTemplate = new DTemplate ();
			Assert.AreEqual (typeof(DTemplate ),dv.FooterTemplate.GetType() ,"FooterTemplate");
			dv.FooterText = "Footer Text";
			Assert.AreEqual ("Footer Text", dv.FooterText, "FooterText");
			dv.GridLines = GridLines.Horizontal;
			Assert.AreEqual (GridLines.Horizontal, dv.GridLines, "GridLinesHorizontal ");
			dv.GridLines = GridLines.None;
			Assert.AreEqual (GridLines.None , dv.GridLines, "GridLinesNone ");
			dv.GridLines = GridLines.Vertical;
			Assert.AreEqual (GridLines.Vertical, dv.GridLines, "GridLinesVertical ");
			dv.GridLines = GridLines.Both;
			Assert.AreEqual (GridLines.Both, dv.GridLines, "GridLinesBoth ");
			dv.HeaderStyle.BorderColor = Color.PapayaWhip;
			Assert.AreEqual (Color.PapayaWhip, dv.HeaderStyle.BorderColor, "HeaderStyle");
			dv.HeaderTemplate = new DTemplate ();
			Assert.AreEqual (typeof (DTemplate), dv.HeaderTemplate.GetType (), "HeaderTemplate"); 
			dv.HeaderText = "Header Text";
			Assert.AreEqual ("Header Text", dv.HeaderText, "HeaderText");
			dv.HorizontalAlign = HorizontalAlign.Center;
			Assert.AreEqual (HorizontalAlign.Center, dv.HorizontalAlign, "HorizontalAlignCenter");
			dv.HorizontalAlign = HorizontalAlign.Justify;
			Assert.AreEqual (HorizontalAlign.Justify , dv.HorizontalAlign, "HorizontalAlignJustify");
			dv.HorizontalAlign = HorizontalAlign.Left ;
			Assert.AreEqual (HorizontalAlign.Left , dv.HorizontalAlign, "HorizontalAlignLeft");
			dv.HorizontalAlign = HorizontalAlign.NotSet ;
			Assert.AreEqual (HorizontalAlign.NotSet , dv.HorizontalAlign, "HorizontalAlignNotSet");
			dv.HorizontalAlign = HorizontalAlign.Right ;
			Assert.AreEqual (HorizontalAlign.Right , dv.HorizontalAlign, "HorizontalAlignRight");
			dv.InsertRowStyle.BackColor = Color.PeachPuff;
			Assert.AreEqual (Color.PeachPuff, dv.InsertRowStyle.BackColor, "InsertRowStyle");
			Assert.AreEqual (6, dv.PageCount, "PageCount");
			Assert.AreEqual (0, dv.PageIndex, "PageIndex");
			dv.PagerSettings.LastPageImageUrl = "image.jpg";
			Assert.AreEqual ("image.jpg", dv.PagerSettings.LastPageImageUrl, "PagerSettings");
			dv.PagerStyle.CssClass = "style.css";
			Assert.AreEqual ("style.css", dv.PagerStyle.CssClass, "PagerStyle");
			dv.PagerTemplate = new DTemplate ();
			Assert.AreEqual (typeof (DTemplate), dv.PagerTemplate.GetType (), "PagerTemplate");
			Assert.AreEqual (1, dv.Rows.Count, "Rows");
			dv.RowStyle.BackColor  = Color.Plum  ;
//.........这里部分代码省略.........
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:101,代码来源:DetailsViewTest.cs


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