Fhnw.Ecnf.RoutePlanner.RoutePlannerLib.City.Equals C# (CSharp) Method

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool
        public override bool Equals(object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return false;
            }
            // If parameter cannot be cast to Point return false.
            var p = obj as City;
            if ((System.Object)p == null)
            {
                return false;
            }
            return this.Equal((City) obj);
        }

Usage Example

Exemplo n.º 1
0
 protected Link FindLink(City fromC, City toC, TransportModes mode)
 {
     return((from l in routes
             where mode.Equals(l.TransportMode) &&
             ((fromC.Equals(l.FromCity) && toC.Equals(l.ToCity)) ||
              (toC.Equals(l.FromCity) && fromC.Equals(l.ToCity)))
             select new Link(fromC, toC, l.Distance, TransportModes.Rail)).FirstOrDefault());
 }
All Usage Examples Of Fhnw.Ecnf.RoutePlanner.RoutePlannerLib.City::Equals