public override bool Equals(Object obj) { if (this == obj) { return(true); } if (obj is ChannelId) { ChannelId id = (ChannelId)obj; if (id.depth() == depth()) { for (int i = id.depth(); i-- > 0;) { if (!id.getSegment(i).Equals(getSegment(i))) { return(false); } } return(true); } } return(false); }