/// <summary> /// Deserializes the instance of this class. /// </summary> /// <param name="info">Serialization info.</param> /// <param name="context">Streaming context.</param> private ArithmeticStruct(SerializationInfo info, StreamingContext context) { Arithmetic = (Arithmetic <T>)info.GetValue("Arithmetic", typeof(Arithmetic <T>)); Zero = Arithmetic == null ? default(T) : Arithmetic.Zero; One = Arithmetic == null ? default(T) : Arithmetic.One; MinValue = Arithmetic == null ? default(T) : Arithmetic.MinValue; MaxValue = Arithmetic == null ? default(T) : Arithmetic.MaxValue; IsSigned = Arithmetic == null ? true : Arithmetic.IsSigned; Add = Arithmetic == null ? null : Arithmetic.Add; Subtract = Arithmetic == null ? null : Arithmetic.Subtract; Multiply = Arithmetic == null ? null : Arithmetic.Multiply; Divide = Arithmetic == null ? null : Arithmetic.Divide; Negation = Arithmetic == null ? null : Arithmetic.Negation; ApplyRules = Arithmetic == null ? null : Arithmetic.ApplyRules; }
// Constructors /// <summary> /// Initializes a new instance of this type. /// </summary> /// <param name="arithmetic">Arithmetic to provide the delegates for.</param> private ArithmeticStruct(Arithmetic <T> arithmetic) { Arithmetic = arithmetic; Zero = Arithmetic == null ? default(T) : Arithmetic.Zero; One = Arithmetic == null ? default(T) : Arithmetic.One; MinValue = Arithmetic == null ? default(T) : Arithmetic.MinValue; MaxValue = Arithmetic == null ? default(T) : Arithmetic.MaxValue; IsSigned = Arithmetic == null ? true : Arithmetic.IsSigned; Add = Arithmetic == null ? null : Arithmetic.Add; Subtract = Arithmetic == null ? null : Arithmetic.Subtract; Multiply = Arithmetic == null ? null : Arithmetic.Multiply; Divide = Arithmetic == null ? null : Arithmetic.Divide; Negation = Arithmetic == null ? null : Arithmetic.Negation; ApplyRules = Arithmetic == null ? null : Arithmetic.ApplyRules; }