Exemplo 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("-");
 }
Exemplo 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);
        }
Exemplo 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();
 }
Exemplo 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;
 }