/// <summary>
        /// Check if this segment is equal to another segment.
        /// </summary>
        /// <param name="other">the other segment to check.</param>
        /// <returns>true if the other segment is equal.</returns>
        /// <exception cref="System.ArgumentNullException">Throws if the input other is null.</exception>
        internal override bool Equals(ODataPathSegment other)
        {
            ExceptionUtils.CheckArgumentNotNull(other, "other");
            SingletonSegment otherSingleton = other as SingletonSegment;

            return(otherSingleton != null && otherSingleton.singleton == this.Singleton);
        }
 /// <summary>
 /// Translate an SingletonSegment
 /// </summary>
 /// <param name="segment">the segment to Translate</param>
 /// <returns>Defined by the implementer.</returns>
 public override string Translate(SingletonSegment segment)
 {
     Debug.Assert(segment != null, "segment != null");
     return("/" + segment.Singleton.Name);
 }
Exemple #3
0
 /// <summary>
 /// Handle an SingletonSegment
 /// </summary>
 /// <param name="segment">the segment to Handle</param>
 public virtual void Handle(SingletonSegment segment)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Handle an SingletonSegment
 /// </summary>
 /// <param name="segment">the segment to Handle</param>
 public override void Handle(SingletonSegment segment)
 {
     CommonHandler(segment);
 }
Exemple #5
0
 /// <summary>
 /// Translate an SingletonSegment
 /// </summary>
 /// <param name="segment">the segment to Translate</param>
 /// <returns>Defined by the implementer.</returns>
 public virtual T Translate(SingletonSegment segment)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Determine the NavigationSource of a SingletonSegment
 /// </summary>
 /// <param name="segment">The SingletonSegment to look in.</param>
 /// <returns>The IEdmNavigationSource of this SingletonSegment</returns>
 /// <exception cref="System.ArgumentNullException">Throws if the input segment is null.</exception>
 public override IEdmNavigationSource Translate(SingletonSegment segment)
 {
     ExceptionUtils.CheckArgumentNotNull(segment, "segment");
     return(segment.Singleton);
 }