/// <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(Value, typeof(T).GetDefault()))
     {
         return(Value.ToString());
     }
     if (GpraNonResponse != null)
     {
         return(GpraNonResponse.ToString());
     }
     return("-");
 }
Exemple #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(Value, typeof(T).GetDefault()))
            {
                hash ^= Value.GetHashCode();
            }
            else if (GpraNonResponse != null)
            {
                hash ^= GpraNonResponse.GetHashCode();
            }
            return(hash);
        }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GpraNonResponseType&lt;T&gt;"/> struct.
 /// </summary>
 /// <param name="gpraNonResponse">The gpra non response.</param>
 public GpraNonResponseType(GpraNonResponse gpraNonResponse)
 {
     Check.IsNotNull(gpraNonResponse, "GpraNonResponse cannot equal null.");
     _gpraNonResponse = gpraNonResponse;
     _value           = (T)typeof(T).GetDefault();
 }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GpraNonResponseType&lt;T&gt;"/> struct.
 /// </summary>
 /// <param name="value">The value.</param>
 public GpraNonResponseType(T value)
 {
     Check.IsNotNull(value, "Value Cannot be Null.");
     _value           = value;
     _gpraNonResponse = null;
 }