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


C# MonthCalendar.RemoveAllAnnuallyBoldedDates方法代码示例

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


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

示例1: RemoveAnnuallyBoldedDateTest

		public void RemoveAnnuallyBoldedDateTest ()
		{
			MonthCalendar myMonthCal = new MonthCalendar ();

			DateTime[] dts = new DateTime [10];
			dts[0] = new DateTime (2001, 02, 03, 04, 05, 06, 07); // base datetime
 			dts[1] = new DateTime (2001, 02, 03); // only date 
			dts[2] = new DateTime (2002, 03, 04); // only date, different
			dts[3] = new DateTime (2002, 02, 03, 04, 05, 06, 07); // different year
			dts[4] = new DateTime (2001, 03, 03, 04, 05, 06, 07); // different month
			dts[5] = new DateTime (2001, 02, 04, 04, 05, 06, 07); // etc...
			dts[6] = new DateTime (2001, 02, 03, 05, 05, 06, 07);
			dts[7] = new DateTime (2001, 02, 03, 04, 06, 06, 07);
			dts[8] = new DateTime (2001, 02, 03, 04, 05, 07, 07);
			dts[9] = new DateTime (2001, 02, 03, 04, 05, 06, 08);

			for (int i = 0; i < dts.Length; i++) {
				for (int j = 0; j < dts.Length; j++) {
					myMonthCal.RemoveAllAnnuallyBoldedDates ();
					myMonthCal.AddAnnuallyBoldedDate (dts [j]);
					myMonthCal.RemoveAnnuallyBoldedDate (dts [i]);
					if (dts [j].Month == dts [i].Month && dts [j].Day == dts [i].Day)
						Assert.AreEqual (0, myMonthCal.AnnuallyBoldedDates.Length, "#remove0" + i.ToString () + ", " + j.ToString ());
					else
						Assert.AreEqual (1, myMonthCal.AnnuallyBoldedDates.Length, "#remove0" + i.ToString () + ", " + j.ToString ());
				}
			}
			
			for (int i = 0; i < dts.Length; i++) 
			{
				myMonthCal.AnnuallyBoldedDates = dts;
				myMonthCal.RemoveAnnuallyBoldedDate (dts [i]);
				Assert.AreEqual (9, myMonthCal.AnnuallyBoldedDates.Length, "#remove1" + i.ToString ());
			}
		}
开发者ID:Profit0004,项目名称:mono,代码行数:35,代码来源:MonthCalendarTest.cs

示例2: AddAnnuallyBoldedDateTest

		public void AddAnnuallyBoldedDateTest ()
		{
			Form myForm = new Form ();
			myForm.ShowInTaskbar = false;
			MonthCalendar myMonthCal = new MonthCalendar ();
			myMonthCal.AddAnnuallyBoldedDate (new DateTime (2005, 09, 01));
			myForm.Controls.Add (myMonthCal);
			Assert.AreEqual (new DateTime (2005, 09, 01), myMonthCal.AnnuallyBoldedDates.GetValue (0), "#add1");

			DateTime dt = new DateTime (2006, 02, 03, 04, 05, 06, 07);
			DateTime dt2 = new DateTime (2006, 02, 03);

			myMonthCal.RemoveAllAnnuallyBoldedDates ();
			myMonthCal.AddAnnuallyBoldedDate (dt);
			Assert.AreEqual (dt, myMonthCal.AnnuallyBoldedDates [0], "#add2");

			myMonthCal.AddAnnuallyBoldedDate (dt2);
			Assert.AreEqual (dt2, myMonthCal.AnnuallyBoldedDates [1], "#add3");

			myForm.Dispose ();
		}
开发者ID:Profit0004,项目名称:mono,代码行数:21,代码来源:MonthCalendarTest.cs


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