Ejemplo n.º 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 IEventCountersItemTemplateTable source, DbParameterValues paramValues)
        {
            for (var i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                case "counter":
                    paramValues[i] = source.Counter;
                    break;

                case "item_template_event_counter_id":
                    paramValues[i] = source.ItemTemplateEventCounterId;
                    break;

                case "item_template_id":
                    paramValues[i] = (UInt16)source.ItemTemplateID;
                    break;
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Checks if this <see cref="IEventCountersItemTemplateTable"/> contains the same values as another <see cref="IEventCountersItemTemplateTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="IEventCountersItemTemplateTable"/>.</param>
 /// <param name="otherItem">The <see cref="IEventCountersItemTemplateTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="IEventCountersItemTemplateTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this IEventCountersItemTemplateTable source, IEventCountersItemTemplateTable otherItem)
 {
     return(Equals(source.Counter, otherItem.Counter) &&
            Equals(source.ItemTemplateEventCounterId, otherItem.ItemTemplateEventCounterId) &&
            Equals(source.ItemTemplateID, otherItem.ItemTemplateID));
 }
Ejemplo n.º 3
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this EventCountersItemTemplateTable.
/// </summary>
/// <param name="source">The IEventCountersItemTemplateTable to copy the values from.</param>
public void CopyValuesFrom(IEventCountersItemTemplateTable source)
{
this.Counter = (System.Int64)source.Counter;
this.ItemTemplateEventCounterId = (System.Byte)source.ItemTemplateEventCounterId;
this.ItemTemplateID = (DemoGame.ItemTemplateID)source.ItemTemplateID;
}
Ejemplo n.º 4
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 IEventCountersItemTemplateTable source, DbParameterValues paramValues)
 {
     paramValues["counter"] = source.Counter;
     paramValues["item_template_event_counter_id"] = source.ItemTemplateEventCounterId;
     paramValues["item_template_id"] = (UInt16)source.ItemTemplateID;
 }
Ejemplo n.º 5
0
/// <summary>
/// Initializes a new instance of the <see cref="EventCountersItemTemplateTable"/> class.
/// </summary>
/// <param name="source">IEventCountersItemTemplateTable to copy the initial values from.</param>
public EventCountersItemTemplateTable(IEventCountersItemTemplateTable source)
{
CopyValuesFrom(source);
}
Ejemplo n.º 6
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(IEventCountersItemTemplateTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic)
{
dic["counter"] = (System.Int64)source.Counter;
dic["item_template_event_counter_id"] = (System.Byte)source.ItemTemplateEventCounterId;
dic["item_template_id"] = (DemoGame.ItemTemplateID)source.ItemTemplateID;
}
 /// <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(IEventCountersItemTemplateTable source, IDictionary<String, Object> dic)
 {
     dic["counter"] = source.Counter;
     dic["item_template_event_counter_id"] = source.ItemTemplateEventCounterId;
     dic["item_template_id"] = source.ItemTemplateID;
 }
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this EventCountersItemTemplateTable.
 /// </summary>
 /// <param name="source">The IEventCountersItemTemplateTable to copy the values from.</param>
 public void CopyValuesFrom(IEventCountersItemTemplateTable source)
 {
     Counter = source.Counter;
     ItemTemplateEventCounterId = source.ItemTemplateEventCounterId;
     ItemTemplateID = source.ItemTemplateID;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this EventCountersItemTemplateTable.
 /// </summary>
 /// <param name="source">The IEventCountersItemTemplateTable to copy the values from.</param>
 public void CopyValuesFrom(IEventCountersItemTemplateTable source)
 {
     Counter = source.Counter;
     ItemTemplateEventCounterId = source.ItemTemplateEventCounterId;
     ItemTemplateID             = source.ItemTemplateID;
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventCountersItemTemplateTable"/> class.
 /// </summary>
 /// <param name="source">IEventCountersItemTemplateTable to copy the initial values from.</param>
 public EventCountersItemTemplateTable(IEventCountersItemTemplateTable source)
 {
     CopyValuesFrom(source);
 }
Ejemplo n.º 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(IEventCountersItemTemplateTable source, IDictionary <String, Object> dic)
 {
     dic["counter"] = source.Counter;
     dic["item_template_event_counter_id"] = source.ItemTemplateEventCounterId;
     dic["item_template_id"] = source.ItemTemplateID;
 }
/// <summary>
/// Checks if this <see cref="IEventCountersItemTemplateTable"/> contains the same values as another <see cref="IEventCountersItemTemplateTable"/>.
/// </summary>
/// <param name="source">The source <see cref="IEventCountersItemTemplateTable"/>.</param>
/// <param name="otherItem">The <see cref="IEventCountersItemTemplateTable"/> to compare the values to.</param>
/// <returns>
/// True if this <see cref="IEventCountersItemTemplateTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
/// </returns>
public static System.Boolean HasSameValues(this IEventCountersItemTemplateTable source, IEventCountersItemTemplateTable otherItem)
{
return Equals(source.Counter, otherItem.Counter) && 
Equals(source.ItemTemplateEventCounterId, otherItem.ItemTemplateEventCounterId) && 
Equals(source.ItemTemplateID, otherItem.ItemTemplateID);
}
/// <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 IEventCountersItemTemplateTable source, NetGore.Db.DbParameterValues paramValues)
        {
            paramValues["counter"] = (System.Int64)source.Counter;
            paramValues["item_template_event_counter_id"] = (System.Byte)source.ItemTemplateEventCounterId;
            paramValues["item_template_id"] = (System.UInt16)source.ItemTemplateID;
        }
Ejemplo n.º 14
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this EventCountersItemTemplateTable.
/// </summary>
/// <param name="source">The IEventCountersItemTemplateTable to copy the values from.</param>
        public void CopyValuesFrom(IEventCountersItemTemplateTable source)
        {
            this.Counter = (System.Int64)source.Counter;
            this.ItemTemplateEventCounterId = (System.Byte)source.ItemTemplateEventCounterId;
            this.ItemTemplateID             = (DemoGame.ItemTemplateID)source.ItemTemplateID;
        }
Ejemplo n.º 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(IEventCountersItemTemplateTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic)
        {
            dic["counter"] = (System.Int64)source.Counter;
            dic["item_template_event_counter_id"] = (System.Byte)source.ItemTemplateEventCounterId;
            dic["item_template_id"] = (DemoGame.ItemTemplateID)source.ItemTemplateID;
        }