Esempio n. 1
0
 /// <summary>
 /// Returns a <see cref="System.String"/> that represents this instance.
 /// </summary>
 /// <returns>A <see cref="System.String"/> that represents this instance.</returns>
 public override string ToString()
 {
     if (!Equals(Response, typeof(T).GetDefault()))
     {
         return(Response.ToString());
     }
     if (TedsNonResponse != null)
     {
         return(TedsNonResponse.ToString());
     }
     return("-");
 }
Esempio n. 2
0
        /// <summary>
        /// Returns a hash code for this instance.
        /// </summary>
        /// <returns>
        /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
        /// </returns>
        public override int GetHashCode()
        {
            int hash = 0;

            if (!Equals(Response, typeof(T).GetDefault()))
            {
                hash ^= Response.GetHashCode();
            }
            else if (TedsNonResponse != null)
            {
                hash ^= TedsNonResponse.GetHashCode();
            }
            return(hash);
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TedsAnswer&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="tedsNonResponse">The teds non response.</param>
 public TedsAnswer(TedsNonResponse tedsNonResponse)
 {
     Check.IsNotNull(tedsNonResponse, "TedsNonResponse cannot equal null.");
     _tedsNonResponse = tedsNonResponse;
     _response        = (T)typeof(T).GetDefault();
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TedsAnswer&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="response">The response.</param>
 public TedsAnswer(T response)
 {
     Check.IsNotNull(response, "Response cannot be null.");
     _response        = response;
     _tedsNonResponse = null;
 }