コード例 #1
0
        public bool Equals(BankCard other)
        {
            if (null == _number)
            {
                return(null == other._number);
            }

            return(_number.Equals(other._number, StringComparison.Ordinal));
        }
コード例 #2
0
        public static bool TryParse(string value, out BankCard bankCard)
        {
            if (string.IsNullOrEmpty(value))
            {
                bankCard = default(BankCard);
                return(false);
            }

            Match match = Regex.Match(value, Pattern);

            if (match.Value != value)
            {
                bankCard = default(BankCard);
                return(false);
            }

            bankCard = new BankCard(value);
            return(true);
        }