コード例 #1
0
        /// <summary>
        /// Calculate the rate of change based on the samples currently added.
        /// </summary>
        /// <returns>
        /// The rate of change of the passed values, calculated over the indicated interval.
        /// If no samples are available, the rate of change is considered to be 0.
        /// </returns>
        public TValue GetCurrentRateOfChange()
        {
            if (_samples.Count == 0)
            {
                return(CastOperator <double, TValue> .Cast(0));
            }

            Tuple <TValue, TOver> first = _samples.First();
            Tuple <TValue, TOver> last  = _samples.Last();

            double valueDiff = CastOperator <TValue, double> .Cast(Operator <TValue> .Subtract(last.Item1, first.Item1));

            double overDiff = CastOperator <TOver, double> .Cast(Operator <TOver> .Subtract(last.Item2, first.Item2));

            return(CastOperator <double, TValue> .Cast(valueDiff / overDiff));
        }
コード例 #2
0
 public SPFieldType GetDataProviderFieldType(FieldType fieldType)
 {
     return(fieldTypes.First(x => x.Item1 == fieldType).Item2);
 }
コード例 #3
0
 public FieldType GetDataMigratorFieldType(SPFieldType providerFieldType)
 {
     return(providerFieldTypes.First(x => x.Item1 == providerFieldType).Item2);
 }
コード例 #4
0
 public static string GetMySqlDataTypeStringValue(MySqlDbType mySqlDbType)
 {
     return(mySqlDbTypes2.First(x => x.Item1 == mySqlDbType).Item2);
 }
コード例 #5
0
 public FieldType GetDataMigratorFieldType(DbType dbType)
 {
     return(dbTypes.First(x => x.Item1 == dbType).Item2);
 }