/// <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 IEventCountersMapTable source, DbParameterValues paramValues) { for (var i = 0; i < paramValues.Count; i++) { switch (paramValues.GetParameterName(i)) { case "counter": paramValues[i] = source.Counter; break; case "map_event_counter_id": paramValues[i] = source.MapEventCounterId; break; case "map_id": paramValues[i] = (UInt16)source.MapID; 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 IEventCountersMapTable source, NetGore.Db.DbParameterValues paramValues) { for (int i = 0; i < paramValues.Count; i++) { switch (paramValues.GetParameterName(i)) { case "counter": paramValues[i] = (System.Int64)source.Counter; break; case "map_event_counter_id": paramValues[i] = (System.Byte)source.MapEventCounterId; break; case "map_id": paramValues[i] = (System.UInt16)source.MapID; break; } } }
/// <summary> /// Initializes a new instance of the <see cref="EventCountersMapTable"/> class. /// </summary> /// <param name="source">IEventCountersMapTable to copy the initial values from.</param> public EventCountersMapTable(IEventCountersMapTable source) { CopyValuesFrom(source); }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this EventCountersMapTable. /// </summary> /// <param name="source">The IEventCountersMapTable to copy the values from.</param> public void CopyValuesFrom(IEventCountersMapTable source) { Counter = source.Counter; MapEventCounterId = source.MapEventCounterId; MapID = source.MapID; }
/// <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(IEventCountersMapTable source, IDictionary<String, Object> dic) { dic["counter"] = source.Counter; dic["map_event_counter_id"] = source.MapEventCounterId; dic["map_id"] = source.MapID; }
/// <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(IEventCountersMapTable source, IDictionary <String, Object> dic) { dic["counter"] = source.Counter; dic["map_event_counter_id"] = source.MapEventCounterId; dic["map_id"] = source.MapID; }
/// <summary> /// Checks if this <see cref="IEventCountersMapTable"/> contains the same values as another <see cref="IEventCountersMapTable"/>. /// </summary> /// <param name="source">The source <see cref="IEventCountersMapTable"/>.</param> /// <param name="otherItem">The <see cref="IEventCountersMapTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IEventCountersMapTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static Boolean HasSameValues(this IEventCountersMapTable source, IEventCountersMapTable otherItem) { return Equals(source.Counter, otherItem.Counter) && Equals(source.MapEventCounterId, otherItem.MapEventCounterId) && Equals(source.MapID, otherItem.MapID); }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this EventCountersMapTable. /// </summary> /// <param name="source">The IEventCountersMapTable to copy the values from.</param> public void CopyValuesFrom(IEventCountersMapTable source) { this.Counter = (System.Int64)source.Counter; this.MapEventCounterId = (System.Byte)source.MapEventCounterId; this.MapID = (NetGore.World.MapID)source.MapID; }
/// <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(IEventCountersMapTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic) { dic["counter"] = (System.Int64)source.Counter; dic["map_event_counter_id"] = (System.Byte)source.MapEventCounterId; dic["map_id"] = (NetGore.World.MapID)source.MapID; }
/// <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 IEventCountersMapTable source, NetGore.Db.DbParameterValues paramValues) { paramValues["counter"] = (System.Int64)source.Counter; paramValues["map_event_counter_id"] = (System.Byte)source.MapEventCounterId; paramValues["map_id"] = (System.UInt16)source.MapID; }
/// <summary> /// Checks if this <see cref="IEventCountersMapTable"/> contains the same values as another <see cref="IEventCountersMapTable"/>. /// </summary> /// <param name="source">The source <see cref="IEventCountersMapTable"/>.</param> /// <param name="otherItem">The <see cref="IEventCountersMapTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IEventCountersMapTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static System.Boolean HasSameValues(this IEventCountersMapTable source, IEventCountersMapTable otherItem) { return(Equals(source.Counter, otherItem.Counter) && Equals(source.MapEventCounterId, otherItem.MapEventCounterId) && Equals(source.MapID, otherItem.MapID)); }
/// <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(IEventCountersMapTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic) { dic["counter"] = (System.Int64)source.Counter; dic["map_event_counter_id"] = (System.Byte)source.MapEventCounterId; dic["map_id"] = (NetGore.World.MapID)source.MapID; }
/// <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 IEventCountersMapTable source, DbParameterValues paramValues) { paramValues["counter"] = source.Counter; paramValues["map_event_counter_id"] = source.MapEventCounterId; paramValues["map_id"] = (UInt16)source.MapID; }