HijriCalendar.HijriAdjustment Özellik

Tanım

Ramazan'ın başında ve sonundaki farkları karşılamak ve ülkeler/bölgeler arasındaki tarih farkını karşılamak için takvime eklenecek veya çıkarılacak gün sayısını alır veya ayarlar.

public:
 property int HijriAdjustment { int get(); void set(int value); };
public int HijriAdjustment { get; set; }
member this.HijriAdjustment : int with get, set
Public Property HijriAdjustment As Integer

Özellik Değeri

Takvime eklenecek veya takvimden çıkarıla gün sayısını gösteren -2 ile 2 arası bir tamsayı.

Özel durumlar

özelliği geçersiz bir değere ayarlanıyor.

Örnekler

Aşağıdaki kod örneğinde tarihin nasıl HijriAdjustment etkilediği gösterilmektedir.

using namespace System;
using namespace System::Globalization;
int main()
{
   
   // Creates and initializes a HijriCalendar.
   HijriCalendar^ myCal = gcnew HijriCalendar;
   
   // Creates a DateTime and initializes it to the second day of the first month of the year 1422.
   DateTime myDT = DateTime(1422,1,2,myCal);
   
   // Displays the current values of the DateTime.
   Console::WriteLine( "HijriAdjustment is {0}.", myCal->HijriAdjustment );
   Console::WriteLine( "   Year is {0}.", myCal->GetYear( myDT ) );
   Console::WriteLine( "   Month is {0}.", myCal->GetMonth( myDT ) );
   Console::WriteLine( "   Day is {0}.", myCal->GetDayOfMonth( myDT ) );
   
   // Sets the HijriAdjustment property to 2.
   myCal->HijriAdjustment = 2;
   Console::WriteLine( "HijriAdjustment is {0}.", myCal->HijriAdjustment );
   Console::WriteLine( "   Year is {0}.", myCal->GetYear( myDT ) );
   Console::WriteLine( "   Month is {0}.", myCal->GetMonth( myDT ) );
   Console::WriteLine( "   Day is {0}.", myCal->GetDayOfMonth( myDT ) );
   
   // Sets the HijriAdjustment property to -2.
   myCal->HijriAdjustment = -2;
   Console::WriteLine( "HijriAdjustment is {0}.", myCal->HijriAdjustment );
   Console::WriteLine( "   Year is {0}.", myCal->GetYear( myDT ) );
   Console::WriteLine( "   Month is {0}.", myCal->GetMonth( myDT ) );
   Console::WriteLine( "   Day is {0}.", myCal->GetDayOfMonth( myDT ) );
}

/*
This code produces the following output.  Results vary depending on the registry settings.

HijriAdjustment is 0.
Year is 1422.
Month is 1.
Day is 2.
HijriAdjustment is 2.
Year is 1422.
Month is 1.
Day is 4.
HijriAdjustment is -2.
Year is 1421.
Month is 12.
Day is 29.

*/
using System;
using System.Globalization;

public class SamplesHijriCalendar  {

   public static void Main()  {

      // Creates and initializes a HijriCalendar.
      HijriCalendar myCal = new HijriCalendar();

      // Creates a DateTime and initializes it to the second day of the first month of the year 1422.
      DateTime myDT = new DateTime( 1422, 1, 2, myCal );

      // Displays the current values of the DateTime.
      Console.WriteLine( "HijriAdjustment is {0}.", myCal.HijriAdjustment );
      Console.WriteLine( "   Year is {0}.", myCal.GetYear( myDT ) );
      Console.WriteLine( "   Month is {0}.", myCal.GetMonth( myDT ) );
      Console.WriteLine( "   Day is {0}.", myCal.GetDayOfMonth( myDT ) );

      // Sets the HijriAdjustment property to 2.
      myCal.HijriAdjustment = 2;
      Console.WriteLine( "HijriAdjustment is {0}.", myCal.HijriAdjustment );
      Console.WriteLine( "   Year is {0}.", myCal.GetYear( myDT ) );
      Console.WriteLine( "   Month is {0}.", myCal.GetMonth( myDT ) );
      Console.WriteLine( "   Day is {0}.", myCal.GetDayOfMonth( myDT ) );

      // Sets the HijriAdjustment property to -2.
      myCal.HijriAdjustment = -2;
      Console.WriteLine( "HijriAdjustment is {0}.", myCal.HijriAdjustment );
      Console.WriteLine( "   Year is {0}.", myCal.GetYear( myDT ) );
      Console.WriteLine( "   Month is {0}.", myCal.GetMonth( myDT ) );
      Console.WriteLine( "   Day is {0}.", myCal.GetDayOfMonth( myDT ) );
   }
}

/*
This code produces the following output.  Results vary depending on the registry settings.

HijriAdjustment is 0.
   Year is 1422.
   Month is 1.
   Day is 2.
HijriAdjustment is 2.
   Year is 1422.
   Month is 1.
   Day is 4.
HijriAdjustment is -2.
   Year is 1421.
   Month is 12.
   Day is 29.

*/
Imports System.Globalization

Public Class SamplesHijriCalendar

   Public Shared Sub Main()

      ' Creates and initializes a HijriCalendar.
      Dim myCal As New HijriCalendar()

      ' Creates a DateTime and initializes it to the second day of the first month of the year 1422.
      Dim myDT As New DateTime(1422, 1, 2, myCal)

      ' Displays the current values of the DateTime.
      Console.WriteLine("HijriAdjustment is {0}.", myCal.HijriAdjustment)
      Console.WriteLine("   Year is {0}.", myCal.GetYear(myDT))
      Console.WriteLine("   Month is {0}.", myCal.GetMonth(myDT))
      Console.WriteLine("   Day is {0}.", myCal.GetDayOfMonth(myDT))

      ' Sets the HijriAdjustment property to 2.
      myCal.HijriAdjustment = 2
      Console.WriteLine("HijriAdjustment is {0}.", myCal.HijriAdjustment)
      Console.WriteLine("   Year is {0}.", myCal.GetYear(myDT))
      Console.WriteLine("   Month is {0}.", myCal.GetMonth(myDT))
      Console.WriteLine("   Day is {0}.", myCal.GetDayOfMonth(myDT))

      ' Sets the HijriAdjustment property to -2.
      myCal.HijriAdjustment = - 2
      Console.WriteLine("HijriAdjustment is {0}.", myCal.HijriAdjustment)
      Console.WriteLine("   Year is {0}.", myCal.GetYear(myDT))
      Console.WriteLine("   Month is {0}.", myCal.GetMonth(myDT))
      Console.WriteLine("   Day is {0}.", myCal.GetDayOfMonth(myDT))

   End Sub

End Class


'This code produces the following output.  Results vary depending on the registry settings.
'
'HijriAdjustment is 0.
'   Year is 1422.
'   Month is 1.
'   Day is 2.
'HijriAdjustment is 2.
'   Year is 1422.
'   Month is 1.
'   Day is 4.
'HijriAdjustment is -2.
'   Year is 1421.
'   Month is 12.
'   Day is 29.

Açıklamalar

Sınıfın HijriCalendar bu uygulaması, Ramazan'ın başında ve sonundaki farkları karşılamak ve ülkeler/bölgeler arasındaki tarih farkını karşılamak için sıfırdan iki güne değer ekleyerek veya çıkararak takvim tarihini ayarlar. Bu değer özelliğinde HijriAdjustment depolanır. Açıkça ayarlanmazsaHijriAdjustment, değerini Denetim Masası bölgesel ve dil seçenekleri bölümündeki ayarlardan türetir ve HKEY_CURRENT_USER\Control Panel\International\AddHijriDate kayıt defteri değerinde depolanır. Ancak, bu bilgiler yaşam süresince AppDomaindeğişebilir. sınıfı, HijriCalendar sistem ayarlarındaki değişiklikleri otomatik olarak algılamaz.

Şunlara uygulanır