バージョン

GetEnumerator メソッド (TimeSlotsCollection)

IEnumerable インターフェイスの実装により、タイプセーフな列挙子が返されます。
シンタックス
'宣言
 
Public Function GetEnumerator() As TimeSlotEnumerator
public TimeSlotEnumerator GetEnumerator()

戻り値の型

タイプ セーフの列挙子。
使用例
Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule

	Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click

		' Interate thru each time slot in the TimeSlotsCollection and display information
		' about each one in the output window.
		Debug.WriteLine("Time slots list (" + Me.UltraDayView1.TimeSlots.Count.ToString() + " total time slots)")
		Debug.IndentLevel += 1

		Dim timeSlot As TimeSlot
		For Each timeSlot In Me.UltraDayView1.TimeSlots
			Debug.WriteLine("Info for Time Slot: " + timeSlot.StartTime.ToShortTimeString() + "-" + timeSlot.EndTime.ToShortTimeString() + " --------------")

			Debug.IndentLevel += 1

			Debug.WriteLine("Index: " + timeSlot.Index.ToString())

			If timeSlot.IsVisible = True Then
				Debug.WriteLine("Time slot is currently visible")
			Else
				Debug.WriteLine("Time slot is currently NOT visible")

			End If

			Debug.IndentLevel -= 1
		Next

		Debug.IndentLevel -= 1

		Debug.WriteLine("End of time slots list")

	End Sub
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;

		private void button16_Click(object sender, System.EventArgs e)
		{

			// Interate thru each time slot in the TimeSlotsCollection and display information
			// about each one in the output window.
			Debug.WriteLine("Time slots list (" + this.ultraDayView1.TimeSlots.Count.ToString() + " total time slots)");
			Debug.IndentLevel++;

			foreach(TimeSlot timeSlot in this.ultraDayView1.TimeSlots)
			{
				Debug.WriteLine("Info for Time Slot: " + timeSlot.StartTime.ToShortTimeString() + "-" + timeSlot.EndTime.ToShortTimeString() + " --------------");

				Debug.IndentLevel++;

				Debug.WriteLine("Index: " + timeSlot.Index.ToString());

				if (timeSlot.IsVisible == true)
					Debug.WriteLine("Time slot is currently visible");
				else
					Debug.WriteLine("Time slot is currently NOT visible");

				Debug.IndentLevel--;
			}

			Debug.IndentLevel--;

			Debug.WriteLine("End of time slots list");

		}
参照