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