'宣言 Public Event DateNavigationButtonClicked As DateNavigationButtonClickedHandler
public event DateNavigationButtonClickedHandler DateNavigationButtonClicked
イベント ハンドラが、このイベントに関連するデータを含む、DateNavigationButtonClickedEventArgs 型の引数を受け取りました。次の DateNavigationButtonClickedEventArgs プロパティには、このイベントの固有の情報が記載されます。
プロパティ | 解説 |
---|---|
ButtonAction | 実行がイベントから戻ったときに行うナビゲーション操作を決定する値を取得または設定します。 |
DateTimeInterval | 日付ナビゲーション ボタンがクリックされた列ヘッダーに関連付けられる DateTimeInterval インスタンスを返します。 |
DateTimeRange | 日付ナビゲーション ボタンがクリックされた列ヘッダーに及ばれる日付/時刻の範囲を説明する DateTimeRange インスタンスを返します。 |
NavigationDirection | ナビゲーションの方向 (前方方向または後方方向) を決定する値を返します。 |
Imports System.Collections.Generic Imports Infragistics.Win Imports Infragistics.Win.UltraWinSchedule Imports System.Diagnostics AddHandler Me.ultraTimeLineView1.DateNavigationButtonClicked, AddressOf Me.OnDateNavigationButtonClicked Private Sub OnDateNavigationButtonClicked(ByVal sender As Object, ByVal e As DateNavigationButtonClickedEventArgs) Dim control As UltraTimelineView = sender Dim timeInterval As TimeInterval = e.DateTimeInterval If Not timeInterval Is Nothing AndAlso _ timeInterval.DateNavigationButtonActionResolved = TimelineViewDateNavigationButtonAction.None Then Dim tzi As TimeZoneInfo = timeInterval.TimeZone If Not tzi Is Nothing AndAlso Not TimeZoneInfo.CurrentTimeZone Is Nothing Then ' Get the StartDateTime from the DateRange, which will ' contain the local time for that TimeZone. Dim nextDate As DateTime = e.DateTimeRange.StartDateTime ' Convert the local time for that TimeZone into local time ' for the current time zone nextDate = New DateTime(nextDate.Ticks, DateTimeKind.Local) Dim utc As DateTime = nextDate.Add(tzi.UtcOffset) If (tzi.IsDaylightSavingTime(utc)) Then utc = utc.Add(tzi.DaylightUtcOffset) nextDate = TimeZoneInfo.CurrentTimeZone.ToLocalTime(utc, DateTimeKind.Utc) ' Get the next/previous date depending on the navigation direction. Dim forward As Boolean = IIf(e.NavigationDirection = DateNavigationDirection.Forward, True, False) nextDate = timeInterval.GetNextDate(nextDate, forward) ' Call EnsureDateTimeVisible to navigate to the date control.EnsureDateTimeVisible(nextDate, forward = False) End If End If End If End Sub
using System.Collections.Generic; using Infragistics.Win; using Infragistics.Win.UltraWinSchedule; using System.Diagnostics; this.ultraTimeLineView1.DateNavigationButtonClicked += new DateNavigationButtonClickedHandler(this.OnDateNavigationButtonClicked); private void OnDateNavigationButtonClicked(object sender, DateNavigationButtonClickedEventArgs e) { UltraTimelineView control = sender as UltraTimelineView; TimeInterval timeInterval = e.DateTimeInterval as TimeInterval; if ( timeInterval != null && timeInterval.DateNavigationButtonActionResolved == TimelineViewDateNavigationButtonAction.None ) { TimeZoneInfo tzi = timeInterval.TimeZone; if ( tzi != null && TimeZoneInfo.CurrentTimeZone != null ) { // Get the StartDateTime from the DateRange, which will // contain the local time for that TimeZone. DateTime next = e.DateTimeRange.StartDateTime; // Convert the local time for that TimeZone into local time // for the current time zone next = new DateTime( next.Ticks, DateTimeKind.Local ); DateTime utc = next.Add( tzi.UtcOffset ); if ( tzi.IsDaylightSavingTime(utc) ) utc = utc.Add( tzi.DaylightUtcOffset ); next = TimeZoneInfo.CurrentTimeZone.ToLocalTime( utc, DateTimeKind.Utc ); // Get the next/previous date depending on the navigation direction. bool forward = e.NavigationDirection == DateNavigationDirection.Forward; next = timeInterval.GetNextDate( next, forward ); // Call EnsureDateTimeVisible to navigate to the date control.EnsureDateTimeVisible( next, forward == false ); } } }