Esempio n. 1
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this AccountIpsTable.
/// </summary>
/// <param name="source">The IAccountIpsTable to copy the values from.</param>
        public void CopyValuesFrom(IAccountIpsTable source)
        {
            this.AccountID = (DemoGame.AccountID)source.AccountID;
            this.ID        = (System.UInt32)source.ID;
            this.Ip        = (System.UInt32)source.Ip;
            this.Time      = (System.DateTime)source.Time;
        }
Esempio n. 2
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 IAccountIpsTable source, DbParameterValues paramValues)
 {
     paramValues["account_id"] = (Int32)source.AccountID;
     paramValues["id"]         = source.ID;
     paramValues["ip"]         = source.Ip;
     paramValues["time"]       = source.Time;
 }
Esempio n. 3
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(IAccountIpsTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic)
        {
            dic["account_id"] = (DemoGame.AccountID)source.AccountID;
            dic["id"]         = (System.UInt32)source.ID;
            dic["ip"]         = (System.UInt32)source.Ip;
            dic["time"]       = (System.DateTime)source.Time;
        }
/// <summary>
/// Checks if this <see cref="IAccountIpsTable"/> contains the same values as another <see cref="IAccountIpsTable"/>.
/// </summary>
/// <param name="source">The source <see cref="IAccountIpsTable"/>.</param>
/// <param name="otherItem">The <see cref="IAccountIpsTable"/> to compare the values to.</param>
/// <returns>
/// True if this <see cref="IAccountIpsTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
/// </returns>
        public static System.Boolean HasSameValues(this IAccountIpsTable source, IAccountIpsTable otherItem)
        {
            return(Equals(source.AccountID, otherItem.AccountID) &&
                   Equals(source.ID, otherItem.ID) &&
                   Equals(source.Ip, otherItem.Ip) &&
                   Equals(source.Time, otherItem.Time));
        }
/// <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 IAccountIpsTable source, NetGore.Db.DbParameterValues paramValues)
        {
            paramValues["account_id"] = (System.Int32)source.AccountID;
            paramValues["id"]         = (System.UInt32)source.ID;
            paramValues["ip"]         = (System.UInt32)source.Ip;
            paramValues["time"]       = (System.DateTime)source.Time;
        }
/// <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 IAccountIpsTable source, NetGore.Db.DbParameterValues paramValues)
        {
            for (int i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                case "account_id":
                    paramValues[i] = (System.Int32)source.AccountID;
                    break;


                case "id":
                    paramValues[i] = (System.UInt32)source.ID;
                    break;


                case "ip":
                    paramValues[i] = (System.UInt32)source.Ip;
                    break;


                case "time":
                    paramValues[i] = (System.DateTime)source.Time;
                    break;
                }
            }
        }
Esempio n. 7
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this AccountIpsTable.
 /// </summary>
 /// <param name="source">The IAccountIpsTable to copy the values from.</param>
 public void CopyValuesFrom(IAccountIpsTable source)
 {
     AccountID = source.AccountID;
     ID        = source.ID;
     Ip        = source.Ip;
     Time      = source.Time;
 }
Esempio n. 8
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(IAccountIpsTable source, IDictionary <String, Object> dic)
 {
     dic["account_id"] = source.AccountID;
     dic["id"]         = source.ID;
     dic["ip"]         = source.Ip;
     dic["time"]       = source.Time;
 }
Esempio n. 9
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 IAccountIpsTable source, DbParameterValues paramValues)
        {
            for (var i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                case "account_id":
                    paramValues[i] = (Int32)source.AccountID;
                    break;

                case "id":
                    paramValues[i] = source.ID;
                    break;

                case "ip":
                    paramValues[i] = source.Ip;
                    break;

                case "time":
                    paramValues[i] = source.Time;
                    break;
                }
            }
        }
Esempio n. 10
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this AccountIpsTable.
/// </summary>
/// <param name="source">The IAccountIpsTable to copy the values from.</param>
public void CopyValuesFrom(IAccountIpsTable source)
{
this.AccountID = (DemoGame.AccountID)source.AccountID;
this.ID = (System.UInt32)source.ID;
this.Ip = (System.UInt32)source.Ip;
this.Time = (System.DateTime)source.Time;
}
Esempio 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(IAccountIpsTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic)
{
dic["account_id"] = (DemoGame.AccountID)source.AccountID;
dic["id"] = (System.UInt32)source.ID;
dic["ip"] = (System.UInt32)source.Ip;
dic["time"] = (System.DateTime)source.Time;
}
Esempio n. 12
0
/// <summary>
/// Initializes a new instance of the <see cref="AccountIpsTable"/> class.
/// </summary>
/// <param name="source">IAccountIpsTable to copy the initial values from.</param>
public AccountIpsTable(IAccountIpsTable source)
{
CopyValuesFrom(source);
}
 /// <summary>
 /// Checks if this <see cref="IAccountIpsTable"/> contains the same values as another <see cref="IAccountIpsTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="IAccountIpsTable"/>.</param>
 /// <param name="otherItem">The <see cref="IAccountIpsTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="IAccountIpsTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this IAccountIpsTable source, IAccountIpsTable otherItem)
 {
     return Equals(source.AccountID, otherItem.AccountID) && Equals(source.ID, otherItem.ID) &&
            Equals(source.Ip, otherItem.Ip) && Equals(source.Time, otherItem.Time);
 }
Esempio n. 14
0
/// <summary>
/// Initializes a new instance of the <see cref="AccountIpsTable"/> class.
/// </summary>
/// <param name="source">IAccountIpsTable to copy the initial values from.</param>
        public AccountIpsTable(IAccountIpsTable source)
        {
            CopyValuesFrom(source);
        }
Esempio n. 15
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this AccountIpsTable.
 /// </summary>
 /// <param name="source">The IAccountIpsTable to copy the values from.</param>
 public void CopyValuesFrom(IAccountIpsTable source)
 {
     AccountID = source.AccountID;
     ID = source.ID;
     Ip = source.Ip;
     Time = source.Time;
 }
Esempio n. 16
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(IAccountIpsTable source, IDictionary<String, Object> dic)
 {
     dic["account_id"] = source.AccountID;
     dic["id"] = source.ID;
     dic["ip"] = source.Ip;
     dic["time"] = source.Time;
 }