Esempio n. 1
0
 /// <summary>Initializes a new instance of the Sum class.</summary>
 /// <param name="parameters">The parameters to utilize in the Sum calculation.</param>
 /// <exception cref="ArgumentNullException">When the specified parameters are null.</exception>
 public Sum(SumParameters parameters) : base()
 {
     lock (syncLock) {
         if (parameters == null)
         {
             throw new ArgumentNullException("parameters", Properties.Resources.paramCantBeNull);
         }
         this.parameters = parameters;
         HashSizeValue   = this.parameters.Order;
     }
 }
Esempio n. 2
0
        /// <summary>Retrieves a standard set of Sum parameters.</summary>
        /// <param name="standard">The name of the standard parameter set to retrieve.</param>
        /// <returns>The Sum Parameters for the given standard.</returns>
        public static SumParameters GetParameters(SumStandard standard)
        {
            SumParameters temp = null;

            switch (standard)
            {
            case SumStandard.Sum8Bit: temp = new SumParameters(8); break;

            case SumStandard.Sum16Bit: temp = new SumParameters(16); break;

            case SumStandard.Sum24Bit: temp = new SumParameters(24); break;

            case SumStandard.Sum32Bit: temp = new SumParameters(32); break;

            case SumStandard.Sum64Bit: temp = new SumParameters(64); break;
            }

            return(temp);
        }
Esempio n. 3
0
 /// <summary>Initializes a new instance of the Sum class.</summary>
 /// <remarks>This constructor implements the default parameters of Sum32Bit.</remarks>
 public Sum() : this(SumParameters.GetParameters(SumStandard.Sum32Bit))
 {
 }