354 {
356 if (registryKey == null)
357 {
358 return 0;
359 }
360 object value = registryKey.GetValue(
"AddHijriDate");
362 {
363 return 0;
364 }
365 int result = 0;
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