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

                case "skill_id":
                    paramValues[i] = (Byte)source.SkillID;
                    break;

                case "time_added":
                    paramValues[i] = source.TimeAdded;
                    break;
                }
            }
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterSkillTable"/> class.
 /// </summary>
 /// <param name="source">ICharacterSkillTable to copy the initial values from.</param>
 public CharacterSkillTable(ICharacterSkillTable source)
 {
     CopyValuesFrom(source);
 }
コード例 #3
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this CharacterSkillTable.
 /// </summary>
 /// <param name="source">The ICharacterSkillTable to copy the values from.</param>
 public void CopyValuesFrom(ICharacterSkillTable source)
 {
     CharacterID = source.CharacterID;
     SkillID = source.SkillID;
     TimeAdded = source.TimeAdded;
 }
コード例 #4
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(ICharacterSkillTable source, IDictionary<String, Object> dic)
 {
     dic["character_id"] = source.CharacterID;
     dic["skill_id"] = source.SkillID;
     dic["time_added"] = source.TimeAdded;
 }
コード例 #5
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 ICharacterSkillTable source, NetGore.Db.DbParameterValues paramValues)
        {
            paramValues["character_id"] = (System.Int32)source.CharacterID;
            paramValues["skill_id"]     = (System.Byte)source.SkillID;
            paramValues["time_added"]   = (System.DateTime)source.TimeAdded;
        }
コード例 #6
0
/// <summary>
/// Checks if this <see cref="ICharacterSkillTable"/> contains the same values as another <see cref="ICharacterSkillTable"/>.
/// </summary>
/// <param name="source">The source <see cref="ICharacterSkillTable"/>.</param>
/// <param name="otherItem">The <see cref="ICharacterSkillTable"/> to compare the values to.</param>
/// <returns>
/// True if this <see cref="ICharacterSkillTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
/// </returns>
        public static System.Boolean HasSameValues(this ICharacterSkillTable source, ICharacterSkillTable otherItem)
        {
            return(Equals(source.CharacterID, otherItem.CharacterID) &&
                   Equals(source.SkillID, otherItem.SkillID) &&
                   Equals(source.TimeAdded, otherItem.TimeAdded));
        }
コード例 #7
0
 /// <summary>
 /// Checks if this <see cref="ICharacterSkillTable"/> contains the same values as another <see cref="ICharacterSkillTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="ICharacterSkillTable"/>.</param>
 /// <param name="otherItem">The <see cref="ICharacterSkillTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="ICharacterSkillTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this ICharacterSkillTable source, ICharacterSkillTable otherItem)
 {
     return Equals(source.CharacterID, otherItem.CharacterID) && Equals(source.SkillID, otherItem.SkillID) &&
            Equals(source.TimeAdded, otherItem.TimeAdded);
 }
コード例 #8
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this CharacterSkillTable.
/// </summary>
/// <param name="source">The ICharacterSkillTable to copy the values from.</param>
public void CopyValuesFrom(ICharacterSkillTable source)
{
this.CharacterID = (DemoGame.CharacterID)source.CharacterID;
this.SkillID = (DemoGame.SkillType)source.SkillID;
this.TimeAdded = (System.DateTime)source.TimeAdded;
}
コード例 #9
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(ICharacterSkillTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic)
{
dic["character_id"] = (DemoGame.CharacterID)source.CharacterID;
dic["skill_id"] = (DemoGame.SkillType)source.SkillID;
dic["time_added"] = (System.DateTime)source.TimeAdded;
}
コード例 #10
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this CharacterSkillTable.
/// </summary>
/// <param name="source">The ICharacterSkillTable to copy the values from.</param>
        public void CopyValuesFrom(ICharacterSkillTable source)
        {
            this.CharacterID = (DemoGame.CharacterID)source.CharacterID;
            this.SkillID     = (DemoGame.SkillType)source.SkillID;
            this.TimeAdded   = (System.DateTime)source.TimeAdded;
        }
コード例 #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(ICharacterSkillTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic)
        {
            dic["character_id"] = (DemoGame.CharacterID)source.CharacterID;
            dic["skill_id"]     = (DemoGame.SkillType)source.SkillID;
            dic["time_added"]   = (System.DateTime)source.TimeAdded;
        }
コード例 #12
0
/// <summary>
/// Initializes a new instance of the <see cref="CharacterSkillTable"/> class.
/// </summary>
/// <param name="source">ICharacterSkillTable to copy the initial values from.</param>
        public CharacterSkillTable(ICharacterSkillTable source)
        {
            CopyValuesFrom(source);
        }
コード例 #13
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 ICharacterSkillTable source, DbParameterValues paramValues)
 {
     paramValues["character_id"] = (Int32)source.CharacterID;
     paramValues["skill_id"]     = (Byte)source.SkillID;
     paramValues["time_added"]   = source.TimeAdded;
 }
コード例 #14
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this CharacterSkillTable.
 /// </summary>
 /// <param name="source">The ICharacterSkillTable to copy the values from.</param>
 public void CopyValuesFrom(ICharacterSkillTable source)
 {
     CharacterID = source.CharacterID;
     SkillID     = source.SkillID;
     TimeAdded   = source.TimeAdded;
 }
コード例 #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(ICharacterSkillTable source, IDictionary <String, Object> dic)
 {
     dic["character_id"] = source.CharacterID;
     dic["skill_id"]     = source.SkillID;
     dic["time_added"]   = source.TimeAdded;
 }