/// <summary>
 /// Checks if this <see cref="IWorldStatsNetworkTable"/> contains the same values as another <see cref="IWorldStatsNetworkTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="IWorldStatsNetworkTable"/>.</param>
 /// <param name="otherItem">The <see cref="IWorldStatsNetworkTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="IWorldStatsNetworkTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this IWorldStatsNetworkTable source, IWorldStatsNetworkTable otherItem)
 {
     return Equals(source.Connections, otherItem.Connections) && Equals(source.ID, otherItem.ID) &&
            Equals(source.RecvBytes, otherItem.RecvBytes) && Equals(source.RecvMessages, otherItem.RecvMessages) &&
            Equals(source.RecvPackets, otherItem.RecvPackets) && Equals(source.SentBytes, otherItem.SentBytes) &&
            Equals(source.SentMessages, otherItem.SentMessages) && Equals(source.SentPackets, otherItem.SentPackets) &&
            Equals(source.When, otherItem.When);
 }
示例#2
0
 /// <summary>
 /// Checks if this <see cref="IWorldStatsNetworkTable"/> contains the same values as another <see cref="IWorldStatsNetworkTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="IWorldStatsNetworkTable"/>.</param>
 /// <param name="otherItem">The <see cref="IWorldStatsNetworkTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="IWorldStatsNetworkTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this IWorldStatsNetworkTable source, IWorldStatsNetworkTable otherItem)
 {
     return(Equals(source.Connections, otherItem.Connections) && Equals(source.ID, otherItem.ID) &&
            Equals(source.RecvBytes, otherItem.RecvBytes) && Equals(source.RecvMessages, otherItem.RecvMessages) &&
            Equals(source.RecvPackets, otherItem.RecvPackets) && Equals(source.SentBytes, otherItem.SentBytes) &&
            Equals(source.SentMessages, otherItem.SentMessages) && Equals(source.SentPackets, otherItem.SentPackets) &&
            Equals(source.When, otherItem.When));
 }
示例#3
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this WorldStatsNetworkTable.
/// </summary>
/// <param name="source">The IWorldStatsNetworkTable to copy the values from.</param>
        public void CopyValuesFrom(IWorldStatsNetworkTable source)
        {
            this.Connections  = (System.UInt16)source.Connections;
            this.ID           = (System.UInt32)source.ID;
            this.RecvBytes    = (System.UInt32)source.RecvBytes;
            this.RecvMessages = (System.UInt32)source.RecvMessages;
            this.RecvPackets  = (System.UInt32)source.RecvPackets;
            this.SentBytes    = (System.UInt32)source.SentBytes;
            this.SentMessages = (System.UInt32)source.SentMessages;
            this.SentPackets  = (System.UInt32)source.SentPackets;
            this.When         = (System.DateTime)source.When;
        }
示例#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(IWorldStatsNetworkTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic)
        {
            dic["connections"]   = (System.UInt16)source.Connections;
            dic["id"]            = (System.UInt32)source.ID;
            dic["recv_bytes"]    = (System.UInt32)source.RecvBytes;
            dic["recv_messages"] = (System.UInt32)source.RecvMessages;
            dic["recv_packets"]  = (System.UInt32)source.RecvPackets;
            dic["sent_bytes"]    = (System.UInt32)source.SentBytes;
            dic["sent_messages"] = (System.UInt32)source.SentMessages;
            dic["sent_packets"]  = (System.UInt32)source.SentPackets;
            dic["when"]          = (System.DateTime)source.When;
        }
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this WorldStatsNetworkTable.
 /// </summary>
 /// <param name="source">The IWorldStatsNetworkTable to copy the values from.</param>
 public void CopyValuesFrom(IWorldStatsNetworkTable source)
 {
     Connections  = source.Connections;
     ID           = source.ID;
     RecvBytes    = source.RecvBytes;
     RecvMessages = source.RecvMessages;
     RecvPackets  = source.RecvPackets;
     SentBytes    = source.SentBytes;
     SentMessages = source.SentMessages;
     SentPackets  = source.SentPackets;
     When         = source.When;
 }
 /// <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(IWorldStatsNetworkTable source, IDictionary <String, Object> dic)
 {
     dic["connections"]   = source.Connections;
     dic["id"]            = source.ID;
     dic["recv_bytes"]    = source.RecvBytes;
     dic["recv_messages"] = source.RecvMessages;
     dic["recv_packets"]  = source.RecvPackets;
     dic["sent_bytes"]    = source.SentBytes;
     dic["sent_messages"] = source.SentMessages;
     dic["sent_packets"]  = source.SentPackets;
     dic["when"]          = source.When;
 }
示例#7
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 IWorldStatsNetworkTable source, DbParameterValues paramValues)
 {
     paramValues["connections"]   = source.Connections;
     paramValues["id"]            = source.ID;
     paramValues["recv_bytes"]    = source.RecvBytes;
     paramValues["recv_messages"] = source.RecvMessages;
     paramValues["recv_packets"]  = source.RecvPackets;
     paramValues["sent_bytes"]    = source.SentBytes;
     paramValues["sent_messages"] = source.SentMessages;
     paramValues["sent_packets"]  = source.SentPackets;
     paramValues["when"]          = source.When;
 }
/// <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 IWorldStatsNetworkTable source, NetGore.Db.DbParameterValues paramValues)
        {
            paramValues["connections"]   = (System.UInt16)source.Connections;
            paramValues["id"]            = (System.UInt32)source.ID;
            paramValues["recv_bytes"]    = (System.UInt32)source.RecvBytes;
            paramValues["recv_messages"] = (System.UInt32)source.RecvMessages;
            paramValues["recv_packets"]  = (System.UInt32)source.RecvPackets;
            paramValues["sent_bytes"]    = (System.UInt32)source.SentBytes;
            paramValues["sent_messages"] = (System.UInt32)source.SentMessages;
            paramValues["sent_packets"]  = (System.UInt32)source.SentPackets;
            paramValues["when"]          = (System.DateTime)source.When;
        }
/// <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 IWorldStatsNetworkTable source, NetGore.Db.DbParameterValues paramValues)
        {
            for (int i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                case "connections":
                    paramValues[i] = (System.UInt16)source.Connections;
                    break;


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


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


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


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


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


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


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


                case "when":
                    paramValues[i] = (System.DateTime)source.When;
                    break;
                }
            }
        }
示例#10
0
/// <summary>
/// Initializes a new instance of the <see cref="WorldStatsNetworkTable"/> class.
/// </summary>
/// <param name="source">IWorldStatsNetworkTable to copy the initial values from.</param>
        public WorldStatsNetworkTable(IWorldStatsNetworkTable source)
        {
            CopyValuesFrom(source);
        }
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this WorldStatsNetworkTable.
 /// </summary>
 /// <param name="source">The IWorldStatsNetworkTable to copy the values from.</param>
 public void CopyValuesFrom(IWorldStatsNetworkTable source)
 {
     Connections = source.Connections;
     ID = source.ID;
     RecvBytes = source.RecvBytes;
     RecvMessages = source.RecvMessages;
     RecvPackets = source.RecvPackets;
     SentBytes = source.SentBytes;
     SentMessages = source.SentMessages;
     SentPackets = source.SentPackets;
     When = source.When;
 }
 /// <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(IWorldStatsNetworkTable source, IDictionary<String, Object> dic)
 {
     dic["connections"] = source.Connections;
     dic["id"] = source.ID;
     dic["recv_bytes"] = source.RecvBytes;
     dic["recv_messages"] = source.RecvMessages;
     dic["recv_packets"] = source.RecvPackets;
     dic["sent_bytes"] = source.SentBytes;
     dic["sent_messages"] = source.SentMessages;
     dic["sent_packets"] = source.SentPackets;
     dic["when"] = source.When;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WorldStatsNetworkTable"/> class.
 /// </summary>
 /// <param name="source">IWorldStatsNetworkTable to copy the initial values from.</param>
 public WorldStatsNetworkTable(IWorldStatsNetworkTable source)
 {
     CopyValuesFrom(source);
 }
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this WorldStatsNetworkTable.
/// </summary>
/// <param name="source">The IWorldStatsNetworkTable to copy the values from.</param>
public void CopyValuesFrom(IWorldStatsNetworkTable source)
{
this.Connections = (System.UInt16)source.Connections;
this.ID = (System.UInt32)source.ID;
this.RecvBytes = (System.UInt32)source.RecvBytes;
this.RecvMessages = (System.UInt32)source.RecvMessages;
this.RecvPackets = (System.UInt32)source.RecvPackets;
this.SentBytes = (System.UInt32)source.SentBytes;
this.SentMessages = (System.UInt32)source.SentMessages;
this.SentPackets = (System.UInt32)source.SentPackets;
this.When = (System.DateTime)source.When;
}
/// <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(IWorldStatsNetworkTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic)
{
dic["connections"] = (System.UInt16)source.Connections;
dic["id"] = (System.UInt32)source.ID;
dic["recv_bytes"] = (System.UInt32)source.RecvBytes;
dic["recv_messages"] = (System.UInt32)source.RecvMessages;
dic["recv_packets"] = (System.UInt32)source.RecvPackets;
dic["sent_bytes"] = (System.UInt32)source.SentBytes;
dic["sent_messages"] = (System.UInt32)source.SentMessages;
dic["sent_packets"] = (System.UInt32)source.SentPackets;
dic["when"] = (System.DateTime)source.When;
}