DISABILITARE ADBLOCK

ADBlock sta bloccando alcuni contenuti del sito

ADBlock errore

C# object is not null but (myObject != null) still return false

FONTE PRINCIPALE: https://stackoverflow.com/questions/155458

DOMANDA COMPLETA

SOLUZIONE

Is the == and/or != operator overloaded for the region object's class?

Now that you've posted the code for the overloads:

The overloads should probably look like the following (code taken from postings made by Jon Skeet and Philip Rieck):

public static bool operator ==(Region r1, Region r2)
{
    if (object.ReferenceEquals( r1, r2)) {
        // handles if both are null as well as object identity
        return true;
    }

    if ((object)r1 == null || (object)r2 == null)
    {
       return false;
    }        

    return (r1.Cmr.CompareTo(r2.Cmr) == 0 && r1.Id == r2.Id);
}

public static bool operator !=(Region r1, Region r2)
{
    return !(r1 == r2);
}

NON SEI SODDISFATTO ???

FONTI UTILI

StackOverflow