當前位置: 首頁>>代碼示例>>C#>>正文


C# MonthCalendar.RemoveMonthlyBoldedDate方法代碼示例

本文整理匯總了C#中System.Windows.Forms.MonthCalendar.RemoveMonthlyBoldedDate方法的典型用法代碼示例。如果您正苦於以下問題:C# MonthCalendar.RemoveMonthlyBoldedDate方法的具體用法?C# MonthCalendar.RemoveMonthlyBoldedDate怎麽用?C# MonthCalendar.RemoveMonthlyBoldedDate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Forms.MonthCalendar的用法示例。


在下文中一共展示了MonthCalendar.RemoveMonthlyBoldedDate方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: RemoveMonthlyBoldedDateTest

		public void RemoveMonthlyBoldedDateTest ()
		{
			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.RemoveAllMonthlyBoldedDates ();
					myMonthCal.AddMonthlyBoldedDate (dts [j]);
					myMonthCal.RemoveMonthlyBoldedDate (dts [i]);
					if (dts [j].Month == dts [i].Month && dts [j].Day == dts [i].Day)
						Assert.AreEqual (0, myMonthCal.MonthlyBoldedDates.Length, "#remove0" + i.ToString () + ", " + j.ToString ());
					else
						Assert.AreEqual (1, myMonthCal.MonthlyBoldedDates.Length, "#remove0" + i.ToString () + ", " + j.ToString ());
				}
			}
			
			for (int i = 0; i < dts.Length; i++) 
			{
				myMonthCal.MonthlyBoldedDates = dts;
				myMonthCal.RemoveMonthlyBoldedDate (dts [i]);
				Assert.AreEqual (9, myMonthCal.MonthlyBoldedDates.Length, "#remove1" + i.ToString ());
			}
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:37,代碼來源:MonthCalendarTest.cs


注:本文中的System.Windows.Forms.MonthCalendar.RemoveMonthlyBoldedDate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。