Brunet.Connections.LinkMessage.Equals C# (CSharp) Method

Equals() public method

public Equals ( object olm ) : bool
olm object
return bool
    public override bool Equals(object olm)
    {
      LinkMessage lm = olm as LinkMessage;
      if ( lm != null ) {
        bool same = true;
	same &= (lm.Attributes.Count == Attributes.Count );
	same &= lm.ConTypeString == ConTypeString;
        same &= lm.Token.Equals(Token);
	if( same ) {
          //Make sure all the attributes match:
	  foreach(string key in lm.Attributes.Keys) {
            same &= lm.Attributes[key] == Attributes[key];
	  }
	}
	same &= lm.Local.Equals(_local_ni);
	same &= lm.Remote.Equals(_remote_ni);
	return same;
      }
      else {
        return false;
      }
    }