BrightIdeasSoftware.FlagBitSetFilter.DoesValueMatch C# (CSharp) Method

DoesValueMatch() protected method

Decides if the given property is a match for the values in the PossibleValues collection
protected DoesValueMatch ( object result ) : bool
result object
return bool
        protected override bool DoesValueMatch(object result)
        {
            try {
                UInt64 value = Convert.ToUInt64(result);
                foreach (ulong flag in this.possibleValuesAsUlongs) {
                    if ((value & flag) == flag)
                        return true;
                }
                return false;
            }
            catch (InvalidCastException) {
                return false;
            }
            catch (FormatException) {
                return false;
            }
        }