// Decompiled with JetBrains decompiler
// Type: ListViewSorter.NumberCaseInsensitiveComparer
// Assembly: FileCash_v3.0, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 1DECC99D-34C5-4E02-A85D-DC744B5C555A
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Constructor.MSIL.ArchSMS.a-33cc8dceb24ed9df287e1f92d02773477af42b8d2b6de53a45bb9b5a3ead070b.exe

using System;
using System.Collections;
using System.Text.RegularExpressions;

namespace ListViewSorter
{
  public class NumberCaseInsensitiveComparer : CaseInsensitiveComparer
  {
    public new int Compare(object x, object y)
    {
      if (x == (object) "")
        x = (object) "0";
      if (y == (object) "")
        y = (object) "0";
      return x is string && this.IsWholeNumber((string) x) && y is string && this.IsWholeNumber((string) y) ? base.Compare((object) Convert.ToInt32(x), (object) Convert.ToInt32(y)) : base.Compare(x, y);
    }

    private bool IsWholeNumber(string strNumber) => !new Regex("[^0-9]").IsMatch(strNumber);
  }
}
