コード例 #1
0
        /// <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 IEventCountersQuestTable source, DbParameterValues paramValues)
        {
            for (var i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                case "counter":
                    paramValues[i] = source.Counter;
                    break;

                case "quest_event_counter_id":
                    paramValues[i] = source.QuestEventCounterId;
                    break;

                case "quest_id":
                    paramValues[i] = (UInt16)source.QuestID;
                    break;
                }
            }
        }
コード例 #2
0
/// <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 IEventCountersQuestTable 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 "quest_event_counter_id":
                    paramValues[i] = (System.Byte)source.QuestEventCounterId;
                    break;


                case "quest_id":
                    paramValues[i] = (System.UInt16)source.QuestID;
                    break;
                }
            }
        }
コード例 #3
0
 /// <summary>
 /// Checks if this <see cref="IEventCountersQuestTable"/> contains the same values as another <see cref="IEventCountersQuestTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="IEventCountersQuestTable"/>.</param>
 /// <param name="otherItem">The <see cref="IEventCountersQuestTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="IEventCountersQuestTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this IEventCountersQuestTable source, IEventCountersQuestTable otherItem)
 {
     return Equals(source.Counter, otherItem.Counter) && Equals(source.QuestEventCounterId, otherItem.QuestEventCounterId) &&
            Equals(source.QuestID, otherItem.QuestID);
 }
コード例 #4
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this EventCountersQuestTable.
/// </summary>
/// <param name="source">The IEventCountersQuestTable to copy the values from.</param>
        public void CopyValuesFrom(IEventCountersQuestTable source)
        {
            this.Counter             = (System.Int64)source.Counter;
            this.QuestEventCounterId = (System.Byte)source.QuestEventCounterId;
            this.QuestID             = (NetGore.Features.Quests.QuestID)source.QuestID;
        }
コード例 #5
0
/// <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(IEventCountersQuestTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic)
        {
            dic["counter"] = (System.Int64)source.Counter;
            dic["quest_event_counter_id"] = (System.Byte)source.QuestEventCounterId;
            dic["quest_id"] = (NetGore.Features.Quests.QuestID)source.QuestID;
        }
コード例 #6
0
/// <summary>
/// Initializes a new instance of the <see cref="EventCountersQuestTable"/> class.
/// </summary>
/// <param name="source">IEventCountersQuestTable to copy the initial values from.</param>
        public EventCountersQuestTable(IEventCountersQuestTable source)
        {
            CopyValuesFrom(source);
        }
コード例 #7
0
 /// <summary>
 /// Checks if this <see cref="IEventCountersQuestTable"/> contains the same values as another <see cref="IEventCountersQuestTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="IEventCountersQuestTable"/>.</param>
 /// <param name="otherItem">The <see cref="IEventCountersQuestTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="IEventCountersQuestTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this IEventCountersQuestTable source, IEventCountersQuestTable otherItem)
 {
     return(Equals(source.Counter, otherItem.Counter) && Equals(source.QuestEventCounterId, otherItem.QuestEventCounterId) &&
            Equals(source.QuestID, otherItem.QuestID));
 }
コード例 #8
0
 /// <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 IEventCountersQuestTable source, DbParameterValues paramValues)
 {
     paramValues["counter"] = source.Counter;
     paramValues["quest_event_counter_id"] = source.QuestEventCounterId;
     paramValues["quest_id"] = (UInt16)source.QuestID;
 }
コード例 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventCountersQuestTable"/> class.
 /// </summary>
 /// <param name="source">IEventCountersQuestTable to copy the initial values from.</param>
 public EventCountersQuestTable(IEventCountersQuestTable source)
 {
     CopyValuesFrom(source);
 }
コード例 #10
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this EventCountersQuestTable.
 /// </summary>
 /// <param name="source">The IEventCountersQuestTable to copy the values from.</param>
 public void CopyValuesFrom(IEventCountersQuestTable source)
 {
     Counter = source.Counter;
     QuestEventCounterId = source.QuestEventCounterId;
     QuestID = source.QuestID;
 }
コード例 #11
0
 /// <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(IEventCountersQuestTable source, IDictionary<String, Object> dic)
 {
     dic["counter"] = source.Counter;
     dic["quest_event_counter_id"] = source.QuestEventCounterId;
     dic["quest_id"] = source.QuestID;
 }
コード例 #12
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this EventCountersQuestTable.
 /// </summary>
 /// <param name="source">The IEventCountersQuestTable to copy the values from.</param>
 public void CopyValuesFrom(IEventCountersQuestTable source)
 {
     Counter             = source.Counter;
     QuestEventCounterId = source.QuestEventCounterId;
     QuestID             = source.QuestID;
 }
コード例 #13
0
 /// <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(IEventCountersQuestTable source, IDictionary <String, Object> dic)
 {
     dic["counter"] = source.Counter;
     dic["quest_event_counter_id"] = source.QuestEventCounterId;
     dic["quest_id"] = source.QuestID;
 }
コード例 #14
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this EventCountersQuestTable.
/// </summary>
/// <param name="source">The IEventCountersQuestTable to copy the values from.</param>
public void CopyValuesFrom(IEventCountersQuestTable source)
{
this.Counter = (System.Int64)source.Counter;
this.QuestEventCounterId = (System.Byte)source.QuestEventCounterId;
this.QuestID = (NetGore.Features.Quests.QuestID)source.QuestID;
}
コード例 #15
0
/// <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(IEventCountersQuestTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic)
{
dic["counter"] = (System.Int64)source.Counter;
dic["quest_event_counter_id"] = (System.Byte)source.QuestEventCounterId;
dic["quest_id"] = (NetGore.Features.Quests.QuestID)source.QuestID;
}
コード例 #16
0
/// <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 IEventCountersQuestTable source, NetGore.Db.DbParameterValues paramValues)
        {
            paramValues["counter"] = (System.Int64)source.Counter;
            paramValues["quest_event_counter_id"] = (System.Byte)source.QuestEventCounterId;
            paramValues["quest_id"] = (System.UInt16)source.QuestID;
        }