/// <summary> /// Copies the column values into the given DbParameterValues using the database column name /// with a prefixed @ as the key. The key must already exist in the DbParameterValues /// for the value to be copied over. If any of the keys in the DbParameterValues do not /// match one of the column names, or if there is no field for a key, then it will be /// ignored. Because of this, it is important to be careful when using this method /// since columns or keys can be skipped without any indication. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="paramValues">The DbParameterValues to copy the values into.</param> public static void TryCopyValues(this IServerTimeTable source, NetGore.Db.DbParameterValues paramValues) { for (int i = 0; i < paramValues.Count; i++) { switch (paramValues.GetParameterName(i)) { case "server_time": paramValues[i] = (System.DateTime)source.ServerTime; break; } } }
/// <summary> /// Copies the column values into the given DbParameterValues using the database column name /// with a prefixed @ as the key. The key must already exist in the DbParameterValues /// for the value to be copied over. If any of the keys in the DbParameterValues do not /// match one of the column names, or if there is no field for a key, then it will be /// ignored. Because of this, it is important to be careful when using this method /// since columns or keys can be skipped without any indication. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="paramValues">The DbParameterValues to copy the values into.</param> public static void TryCopyValues(this IServerTimeTable source, DbParameterValues paramValues) { for (var i = 0; i < paramValues.Count; i++) { switch (paramValues.GetParameterName(i)) { case "server_time": paramValues[i] = source.ServerTime; break; } } }
/// <summary> /// Checks if this <see cref="IServerTimeTable"/> contains the same values as another <see cref="IServerTimeTable"/>. /// </summary> /// <param name="source">The source <see cref="IServerTimeTable"/>.</param> /// <param name="otherItem">The <see cref="IServerTimeTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IServerTimeTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static Boolean HasSameValues(this IServerTimeTable source, IServerTimeTable otherItem) { return Equals(source.ServerTime, otherItem.ServerTime); }
/// <summary> /// Initializes a new instance of the <see cref="ServerTimeTable"/> class. /// </summary> /// <param name="source">IServerTimeTable to copy the initial values from.</param> public ServerTimeTable(IServerTimeTable source) { CopyValuesFrom(source); }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this ServerTimeTable. /// </summary> /// <param name="source">The IServerTimeTable to copy the values from.</param> public void CopyValuesFrom(IServerTimeTable source) { ServerTime = source.ServerTime; }
/// <summary> /// Copies the column values into the given Dictionary using the database column name /// with a prefixed @ as the key. The keys must already exist in the Dictionary; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="dic">The Dictionary to copy the values into.</param> public static void CopyValues(IServerTimeTable source, IDictionary<String, Object> dic) { dic["server_time"] = source.ServerTime; }
/// <summary> /// Copies the column values into the given DbParameterValues using the database column name /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="paramValues">The DbParameterValues to copy the values into.</param> public static void CopyValues(this IServerTimeTable source, NetGore.Db.DbParameterValues paramValues) { paramValues["server_time"] = (System.DateTime)source.ServerTime; }
/// <summary> /// Checks if this <see cref="IServerTimeTable"/> contains the same values as another <see cref="IServerTimeTable"/>. /// </summary> /// <param name="source">The source <see cref="IServerTimeTable"/>.</param> /// <param name="otherItem">The <see cref="IServerTimeTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IServerTimeTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static System.Boolean HasSameValues(this IServerTimeTable source, IServerTimeTable otherItem) { return(Equals(source.ServerTime, otherItem.ServerTime)); }
/// <summary> /// Copies the column values into the given DbParameterValues using the database column name /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="paramValues">The DbParameterValues to copy the values into.</param> public static void CopyValues(this IServerTimeTable source, DbParameterValues paramValues) { paramValues["server_time"] = source.ServerTime; }
/// <summary> /// Copies the column values into the given Dictionary using the database column name /// with a prefixed @ as the key. The keys must already exist in the Dictionary; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="dic">The Dictionary to copy the values into.</param> public static void CopyValues(IServerTimeTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic) { dic["server_time"] = (System.DateTime)source.ServerTime; }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this ServerTimeTable. /// </summary> /// <param name="source">The IServerTimeTable to copy the values from.</param> public void CopyValuesFrom(IServerTimeTable source) { this.ServerTime = (System.DateTime)source.ServerTime; }
/// <summary> /// Copies the column values into the given Dictionary using the database column name /// with a prefixed @ as the key. The keys must already exist in the Dictionary; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="dic">The Dictionary to copy the values into.</param> public static void CopyValues(IServerTimeTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic) { dic["server_time"] = (System.DateTime)source.ServerTime; }
/// <summary> /// Copies the column values into the given Dictionary using the database column name /// with a prefixed @ as the key. The keys must already exist in the Dictionary; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="dic">The Dictionary to copy the values into.</param> public static void CopyValues(IServerTimeTable source, IDictionary <String, Object> dic) { dic["server_time"] = source.ServerTime; }