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


C# MonthCalendar.RemoveAllBoldedDates方法代码示例

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


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

示例1: RemoveBoldedDateTest

		public void RemoveBoldedDateTest ()
		{
			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.RemoveAllBoldedDates ();
					myMonthCal.AddBoldedDate (dts [j]);
					myMonthCal.RemoveBoldedDate (dts [i]);
					if (dts [j].Month == dts [i].Month && dts [j].Day == dts [i].Day && dts[j].Year == dts[i].Year)
						Assert.AreEqual (0, myMonthCal.BoldedDates.Length, "#remove0" + i.ToString () + ", " + j.ToString ());
					else
						Assert.AreEqual (1, myMonthCal.BoldedDates.Length, "#remove0" + i.ToString () + ", " + j.ToString ());
				}
			}
			
			for (int i = 0; i < dts.Length; i++) 
			{
				myMonthCal.BoldedDates = dts;
				myMonthCal.RemoveBoldedDate (dts [i]);
				Assert.AreEqual (9, myMonthCal.BoldedDates.Length, "#remove1" + i.ToString ());
			}
		}
开发者ID:Profit0004,项目名称:mono,代码行数:37,代码来源:MonthCalendarTest.cs


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