| | 1 | | // Copyright (c) Microsoft. All rights reserved. |
| | 2 | | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
| | 3 | |
|
| | 4 | | namespace Microsoft.Azure.ServiceBus |
| | 5 | | { |
| | 6 | | /// <summary> |
| | 7 | | /// Matches none the messages arriving to be selected for the subscription. |
| | 8 | | /// </summary> |
| | 9 | | public sealed class FalseFilter : SqlFilter |
| | 10 | | { |
| | 11 | | /// <summary> |
| | 12 | | /// Initializes a new instance of the <see cref="FalseFilter" /> class. |
| | 13 | | /// </summary> |
| | 14 | | public FalseFilter() |
| 0 | 15 | | : base("1=0") |
| | 16 | | { |
| 0 | 17 | | } |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Converts the current instance to its string representation. |
| | 21 | | /// </summary> |
| | 22 | | /// <returns>A string representation of the current instance.</returns> |
| | 23 | | public override string ToString() |
| | 24 | | { |
| 0 | 25 | | return "FalseFilter"; |
| | 26 | | } |
| | 27 | |
|
| | 28 | | public override int GetHashCode() |
| | 29 | | { |
| 0 | 30 | | return base.GetHashCode(); |
| | 31 | | } |
| | 32 | |
|
| | 33 | | public override bool Equals(object obj) |
| | 34 | | { |
| 0 | 35 | | return obj is FalseFilter; |
| | 36 | | } |
| | 37 | |
|
| | 38 | | public override bool Equals(Filter other) |
| | 39 | | { |
| 0 | 40 | | return other is FalseFilter; |
| | 41 | | } |
| | 42 | |
|
| | 43 | | public static bool operator ==(FalseFilter o1, FalseFilter o2) |
| | 44 | | { |
| 0 | 45 | | if (ReferenceEquals(o1, o2)) |
| | 46 | | { |
| 0 | 47 | | return true; |
| | 48 | | } |
| | 49 | |
|
| 0 | 50 | | if (ReferenceEquals(o1, null) || ReferenceEquals(o2, null)) |
| | 51 | | { |
| 0 | 52 | | return false; |
| | 53 | | } |
| | 54 | |
|
| 0 | 55 | | return o1.Equals(o2); |
| | 56 | | } |
| | 57 | |
|
| | 58 | | public static bool operator !=(FalseFilter o1, FalseFilter o2) |
| | 59 | | { |
| 0 | 60 | | return !(o1 == o2); |
| | 61 | | } |
| | 62 | | } |
| | 63 | | } |