/// <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)); }
public SPFieldType GetDataProviderFieldType(FieldType fieldType) { return(fieldTypes.First(x => x.Item1 == fieldType).Item2); }
public FieldType GetDataMigratorFieldType(SPFieldType providerFieldType) { return(providerFieldTypes.First(x => x.Item1 == providerFieldType).Item2); }
public static string GetMySqlDataTypeStringValue(MySqlDbType mySqlDbType) { return(mySqlDbTypes2.First(x => x.Item1 == mySqlDbType).Item2); }
public FieldType GetDataMigratorFieldType(DbType dbType) { return(dbTypes.First(x => x.Item1 == dbType).Item2); }