Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetAdvanceHijriDate()

static int System.Globalization.HijriCalendar.GetAdvanceHijriDate ( )
inlinestaticprivate

Definition at line 353 of file HijriCalendar.cs.

354 {
355 using RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Control Panel\\International");
356 if (registryKey == null)
357 {
358 return 0;
359 }
360 object value = registryKey.GetValue("AddHijriDate");
361 if (value == null)
362 {
363 return 0;
364 }
365 int result = 0;
366 string text = value.ToString();
367 if (string.Compare(text, 0, "AddHijriDate", 0, "AddHijriDate".Length, StringComparison.OrdinalIgnoreCase) == 0)
368 {
369 if (text.Length == "AddHijriDate".Length)
370 {
371 result = -1;
372 }
373 else
374 {
375 try
376 {
377 int num = int.Parse(text.AsSpan("AddHijriDate".Length), NumberStyles.Integer, CultureInfo.InvariantCulture);
378 if (num >= -2 && num <= 2)
379 {
380 result = num;
381 }
382 }
383 catch (ArgumentException)
384 {
385 }
386 catch (FormatException)
387 {
388 }
389 catch (OverflowException)
390 {
391 }
392 }
393 }
394 return result;
395 }
static readonly RegistryKey CurrentUser
Definition Registry.cs:7

References Internal.Win32.Registry.CurrentUser, System.Globalization.CultureInfo.InvariantCulture, System.text, and System.value.

Referenced by System.Globalization.HijriCalendar.GetHijriDateAdjustment().