Esempio n. 1
0
/// <summary>
/// Checks if this <see cref="IGuildTable"/> contains the same values as another <see cref="IGuildTable"/>.
/// </summary>
/// <param name="source">The source <see cref="IGuildTable"/>.</param>
/// <param name="otherItem">The <see cref="IGuildTable"/> to compare the values to.</param>
/// <returns>
/// True if this <see cref="IGuildTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
/// </returns>
        public static System.Boolean HasSameValues(this IGuildTable source, IGuildTable otherItem)
        {
            return(Equals(source.Created, otherItem.Created) &&
                   Equals(source.ID, otherItem.ID) &&
                   Equals(source.Name, otherItem.Name) &&
                   Equals(source.Tag, otherItem.Tag));
        }
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 IGuildTable source, NetGore.Db.DbParameterValues paramValues)
        {
            paramValues["created"] = (System.DateTime)source.Created;
            paramValues["id"]      = (System.UInt16)source.ID;
            paramValues["name"]    = (System.String)source.Name;
            paramValues["tag"]     = (System.String)source.Tag;
        }
Esempio n. 3
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this GuildTable.
/// </summary>
/// <param name="source">The IGuildTable to copy the values from.</param>
        public void CopyValuesFrom(IGuildTable source)
        {
            this.Created = (System.DateTime)source.Created;
            this.ID      = (NetGore.Features.Guilds.GuildID)source.ID;
            this.Name    = (System.String)source.Name;
            this.Tag     = (System.String)source.Tag;
        }
Esempio n. 4
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 IGuildTable source, NetGore.Db.DbParameterValues paramValues)
        {
            for (int i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                case "created":
                    paramValues[i] = (System.DateTime)source.Created;
                    break;


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


                case "name":
                    paramValues[i] = (System.String)source.Name;
                    break;


                case "tag":
                    paramValues[i] = (System.String)source.Tag;
                    break;
                }
            }
        }
Esempio n. 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(IGuildTable source, IDictionary <String, Object> dic)
 {
     dic["created"] = source.Created;
     dic["id"]      = source.ID;
     dic["name"]    = source.Name;
     dic["tag"]     = source.Tag;
 }
Esempio n. 6
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this GuildTable.
 /// </summary>
 /// <param name="source">The IGuildTable to copy the values from.</param>
 public void CopyValuesFrom(IGuildTable source)
 {
     Created = source.Created;
     ID      = source.ID;
     Name    = source.Name;
     Tag     = source.Tag;
 }
 /// <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 IGuildTable source, DbParameterValues paramValues)
 {
     paramValues["created"] = source.Created;
     paramValues["id"]      = (UInt16)source.ID;
     paramValues["name"]    = source.Name;
     paramValues["tag"]     = source.Tag;
 }
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(IGuildTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic)
        {
            dic["created"] = (System.DateTime)source.Created;
            dic["id"]      = (NetGore.Features.Guilds.GuildID)source.ID;
            dic["name"]    = (System.String)source.Name;
            dic["tag"]     = (System.String)source.Tag;
        }
        /// <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 IGuildTable source, DbParameterValues paramValues)
        {
            for (var i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                case "created":
                    paramValues[i] = source.Created;
                    break;

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

                case "name":
                    paramValues[i] = source.Name;
                    break;

                case "tag":
                    paramValues[i] = source.Tag;
                    break;
                }
            }
        }
Esempio n. 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GuildTable"/> class.
 /// </summary>
 /// <param name="source">IGuildTable to copy the initial values from.</param>
 public GuildTable(IGuildTable source)
 {
     CopyValuesFrom(source);
 }
Esempio n. 11
0
/// <summary>
/// Checks if this <see cref="IGuildTable"/> contains the same values as another <see cref="IGuildTable"/>.
/// </summary>
/// <param name="source">The source <see cref="IGuildTable"/>.</param>
/// <param name="otherItem">The <see cref="IGuildTable"/> to compare the values to.</param>
/// <returns>
/// True if this <see cref="IGuildTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
/// </returns>
public static System.Boolean HasSameValues(this IGuildTable source, IGuildTable otherItem)
{
return Equals(source.Created, otherItem.Created) && 
Equals(source.ID, otherItem.ID) && 
Equals(source.Name, otherItem.Name) && 
Equals(source.Tag, otherItem.Tag);
}
Esempio n. 12
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this GuildTable.
/// </summary>
/// <param name="source">The IGuildTable to copy the values from.</param>
public void CopyValuesFrom(IGuildTable source)
{
this.Created = (System.DateTime)source.Created;
this.ID = (NetGore.Features.Guilds.GuildID)source.ID;
this.Name = (System.String)source.Name;
this.Tag = (System.String)source.Tag;
}
Esempio n. 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GuildTable"/> class.
 /// </summary>
 /// <param name="source">IGuildTable to copy the initial values from.</param>
 public GuildTable(IGuildTable source)
 {
     CopyValuesFrom(source);
 }
Esempio n. 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Guild"/> class.
 /// </summary>
 /// <param name="guildManager">The guild manager.</param>
 /// <param name="guildInfo">The guild info.</param>
 public Guild(IGuildManager guildManager, IGuildTable guildInfo)
     : base(guildManager, guildInfo.ID, guildInfo.Name, guildInfo.Tag)
 {
     _created = guildInfo.Created;
 }
Esempio n. 15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Guild"/> class.
 /// </summary>
 /// <param name="guildManager">The guild manager.</param>
 /// <param name="guildInfo">The guild info.</param>
 public Guild(IGuildManager guildManager, IGuildTable guildInfo)
     : base(guildManager, guildInfo.ID, guildInfo.Name, guildInfo.Tag)
 {
     _created = guildInfo.Created;
 }
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(IGuildTable source, IDictionary<String, Object> dic)
 {
     dic["created"] = source.Created;
     dic["id"] = source.ID;
     dic["name"] = source.Name;
     dic["tag"] = source.Tag;
 }
Esempio n. 17
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this GuildTable.
 /// </summary>
 /// <param name="source">The IGuildTable to copy the values from.</param>
 public void CopyValuesFrom(IGuildTable source)
 {
     Created = source.Created;
     ID = source.ID;
     Name = source.Name;
     Tag = source.Tag;
 }
Esempio n. 18
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(IGuildTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic)
{
dic["created"] = (System.DateTime)source.Created;
dic["id"] = (NetGore.Features.Guilds.GuildID)source.ID;
dic["name"] = (System.String)source.Name;
dic["tag"] = (System.String)source.Tag;
}