Version

OnInitializeYear Method

Raises the InitializeYear event when a Year object is created.
Syntax
'Declaration
 
Protected Overridable Sub OnInitializeYear( _
   ByVal e As InitializeYearEventArgs _
) 
protected virtual void OnInitializeYear( 
   InitializeYearEventArgs e
)

Parameters

e
A InitializeYearEventArgs that provides data for the event.
Remarks

Raising an event invokes the event handler through a delegate.

The OnInitializeYear method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Notes to Inheritors: When overriding OnInitializeYear in a derived class, be sure to call the base class's OnInitializeYear method so that registered delegates receive the event.

Example
This example outputs information about the year being initialized to the debugger.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Imports System.Diagnostics

    Private Sub ultraCalendarInfo1_InitializeYear(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinSchedule.InitializeYearEventArgs) Handles ultraCalendarInfo1.InitializeYear

        '----------------------------------------------------------------------------------------------------
        '	Description
        '	InitializeYear
        '
        '	Fires when a Year object is initialized, either through actions performed via the user interface,
        '	or as a result of the GetYear method being called.
        '
        '----------------------------------------------------------------------------------------------------

        Debug.WriteLine("================================================================================")
        Debug.WriteLine("InitializeYear event fired for the year " + e.Year.YearNumber.ToString())
        Debug.WriteLine("================================================================================")
        Debug.WriteLine("")

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

		private void ultraCalendarInfo1_InitializeYear(object sender, Infragistics.Win.UltraWinSchedule.InitializeYearEventArgs e)
		{

			//----------------------------------------------------------------------------------------------------
			//	Description
			//	InitializeYear
			//
			//	Fires when a Year object is initialized, either through actions performed via the user interface,
			//	or as a result of the GetYear method being called.
			//
			//----------------------------------------------------------------------------------------------------
			
			Debug.WriteLine( "================================================================================" );
			Debug.WriteLine( "InitializeYear event fired for the year " + e.Year.YearNumber.ToString() );
			Debug.WriteLine( "================================================================================" );
			Debug.WriteLine( "" );
		
		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also