コード例 #1
0
 /// <summary>
 /// Checks if this <see cref="IAccountBanTable"/> contains the same values as another <see cref="IAccountBanTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="IAccountBanTable"/>.</param>
 /// <param name="otherItem">The <see cref="IAccountBanTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="IAccountBanTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this IAccountBanTable source, IAccountBanTable otherItem)
 {
     return(Equals(source.AccountID, otherItem.AccountID) && Equals(source.EndTime, otherItem.EndTime) &&
            Equals(source.Expired, otherItem.Expired) && Equals(source.ID, otherItem.ID) &&
            Equals(source.IssuedBy, otherItem.IssuedBy) && Equals(source.Reason, otherItem.Reason) &&
            Equals(source.StartTime, otherItem.StartTime));
 }
コード例 #2
0
 /// <summary>
 /// Checks if this <see cref="IAccountBanTable"/> contains the same values as another <see cref="IAccountBanTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="IAccountBanTable"/>.</param>
 /// <param name="otherItem">The <see cref="IAccountBanTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="IAccountBanTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this IAccountBanTable source, IAccountBanTable otherItem)
 {
     return Equals(source.AccountID, otherItem.AccountID) && Equals(source.EndTime, otherItem.EndTime) &&
            Equals(source.Expired, otherItem.Expired) && Equals(source.ID, otherItem.ID) &&
            Equals(source.IssuedBy, otherItem.IssuedBy) && Equals(source.Reason, otherItem.Reason) &&
            Equals(source.StartTime, otherItem.StartTime);
 }
コード例 #3
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this AccountBanTable.
 /// </summary>
 /// <param name="source">The IAccountBanTable to copy the values from.</param>
 public void CopyValuesFrom(IAccountBanTable source)
 {
     AccountID = source.AccountID;
     EndTime   = source.EndTime;
     Expired   = source.Expired;
     ID        = source.ID;
     IssuedBy  = source.IssuedBy;
     Reason    = source.Reason;
     StartTime = source.StartTime;
 }
コード例 #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(IAccountBanTable source, IDictionary <String, Object> dic)
 {
     dic["account_id"] = source.AccountID;
     dic["end_time"]   = source.EndTime;
     dic["expired"]    = source.Expired;
     dic["id"]         = source.ID;
     dic["issued_by"]  = source.IssuedBy;
     dic["reason"]     = source.Reason;
     dic["start_time"] = source.StartTime;
 }
コード例 #5
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this AccountBanTable.
/// </summary>
/// <param name="source">The IAccountBanTable to copy the values from.</param>
        public void CopyValuesFrom(IAccountBanTable source)
        {
            this.AccountID = (DemoGame.AccountID)source.AccountID;
            this.EndTime   = (System.DateTime)source.EndTime;
            this.Expired   = (System.Boolean)source.Expired;
            this.ID        = (System.Int32)source.ID;
            this.IssuedBy  = (System.String)source.IssuedBy;
            this.Reason    = (System.String)source.Reason;
            this.StartTime = (System.DateTime)source.StartTime;
        }
コード例 #6
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 IAccountBanTable source, NetGore.Db.DbParameterValues paramValues)
        {
            paramValues["account_id"] = (System.Int32)source.AccountID;
            paramValues["end_time"]   = (System.DateTime)source.EndTime;
            paramValues["expired"]    = (System.Boolean)source.Expired;
            paramValues["id"]         = (System.Int32)source.ID;
            paramValues["issued_by"]  = (System.String)source.IssuedBy;
            paramValues["reason"]     = (System.String)source.Reason;
            paramValues["start_time"] = (System.DateTime)source.StartTime;
        }
コード例 #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 IAccountBanTable source, DbParameterValues paramValues)
 {
     paramValues["account_id"] = (Int32)source.AccountID;
     paramValues["end_time"]   = source.EndTime;
     paramValues["expired"]    = source.Expired;
     paramValues["id"]         = source.ID;
     paramValues["issued_by"]  = source.IssuedBy;
     paramValues["reason"]     = source.Reason;
     paramValues["start_time"] = source.StartTime;
 }
コード例 #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(IAccountBanTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic)
        {
            dic["account_id"] = (DemoGame.AccountID)source.AccountID;
            dic["end_time"]   = (System.DateTime)source.EndTime;
            dic["expired"]    = (System.Boolean)source.Expired;
            dic["id"]         = (System.Int32)source.ID;
            dic["issued_by"]  = (System.String)source.IssuedBy;
            dic["reason"]     = (System.String)source.Reason;
            dic["start_time"] = (System.DateTime)source.StartTime;
        }
コード例 #9
0
 void UserChat(IAccountBanTable banInfo, int index, int total)
 {
     UserChat("Ban {0} of {1}:", index, total);
     UserChat("   BanID: {0}", banInfo.ID);
     UserChat("   Issued by: {0}", banInfo.IssuedBy);
     UserChat("   Start: {0}", banInfo.StartTime.ToString("U"));
     UserChat("   End: {0}", banInfo.EndTime.ToString("U"));
     UserChat("   Duration: {0}", (banInfo.EndTime - banInfo.StartTime).Duration());
     UserChat("   Remaining (approx): {0}", (DateTime.Now - banInfo.EndTime).Duration());
     UserChat("   Reason: {0}", banInfo.Reason);
 }
コード例 #10
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 IAccountBanTable 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 "end_time":
                    paramValues[i] = (System.DateTime)source.EndTime;
                    break;


                case "expired":
                    paramValues[i] = (System.Boolean)source.Expired;
                    break;


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


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


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


                case "start_time":
                    paramValues[i] = (System.DateTime)source.StartTime;
                    break;
                }
            }
        }
コード例 #11
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 IAccountBanTable 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 "end_time":
                    paramValues[i] = source.EndTime;
                    break;

                case "expired":
                    paramValues[i] = source.Expired;
                    break;

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

                case "issued_by":
                    paramValues[i] = source.IssuedBy;
                    break;

                case "reason":
                    paramValues[i] = source.Reason;
                    break;

                case "start_time":
                    paramValues[i] = source.StartTime;
                    break;
                }
            }
        }
コード例 #12
0
ファイル: AccountBanTable.cs プロジェクト: Vizzini/netgore
 /// <summary>
 /// Initializes a new instance of the <see cref="AccountBanTable"/> class.
 /// </summary>
 /// <param name="source">IAccountBanTable to copy the initial values from.</param>
 public AccountBanTable(IAccountBanTable source)
 {
     CopyValuesFrom(source);
 }
コード例 #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AccountBanTable"/> class.
 /// </summary>
 /// <param name="source">IAccountBanTable to copy the initial values from.</param>
 public AccountBanTable(IAccountBanTable source)
 {
     CopyValuesFrom(source);
 }
コード例 #14
0
 void UserChat(IAccountBanTable banInfo, int index, int total)
 {
     UserChat("Ban {0} of {1}:", index, total);
     UserChat("   BanID: {0}", banInfo.ID);
     UserChat("   Issued by: {0}", banInfo.IssuedBy);
     UserChat("   Start: {0}", banInfo.StartTime.ToString("U"));
     UserChat("   End: {0}", banInfo.EndTime.ToString("U"));
     UserChat("   Duration: {0}", (banInfo.EndTime - banInfo.StartTime).Duration());
     UserChat("   Remaining (approx): {0}", (DateTime.Now - banInfo.EndTime).Duration());
     UserChat("   Reason: {0}", banInfo.Reason);
 }
コード例 #15
0
ファイル: AccountBanTable.cs プロジェクト: wtfcolt/game
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this AccountBanTable.
/// </summary>
/// <param name="source">The IAccountBanTable to copy the values from.</param>
public void CopyValuesFrom(IAccountBanTable source)
{
this.AccountID = (DemoGame.AccountID)source.AccountID;
this.EndTime = (System.DateTime)source.EndTime;
this.Expired = (System.Boolean)source.Expired;
this.ID = (System.Int32)source.ID;
this.IssuedBy = (System.String)source.IssuedBy;
this.Reason = (System.String)source.Reason;
this.StartTime = (System.DateTime)source.StartTime;
}
コード例 #16
0
ファイル: AccountBanTable.cs プロジェクト: Vizzini/netgore
 /// <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(IAccountBanTable source, IDictionary<String, Object> dic)
 {
     dic["account_id"] = source.AccountID;
     dic["end_time"] = source.EndTime;
     dic["expired"] = source.Expired;
     dic["id"] = source.ID;
     dic["issued_by"] = source.IssuedBy;
     dic["reason"] = source.Reason;
     dic["start_time"] = source.StartTime;
 }
コード例 #17
0
ファイル: AccountBanTable.cs プロジェクト: Vizzini/netgore
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this AccountBanTable.
 /// </summary>
 /// <param name="source">The IAccountBanTable to copy the values from.</param>
 public void CopyValuesFrom(IAccountBanTable source)
 {
     AccountID = source.AccountID;
     EndTime = source.EndTime;
     Expired = source.Expired;
     ID = source.ID;
     IssuedBy = source.IssuedBy;
     Reason = source.Reason;
     StartTime = source.StartTime;
 }
コード例 #18
0
ファイル: AccountBanTable.cs プロジェクト: wtfcolt/game
/// <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(IAccountBanTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic)
{
dic["account_id"] = (DemoGame.AccountID)source.AccountID;
dic["end_time"] = (System.DateTime)source.EndTime;
dic["expired"] = (System.Boolean)source.Expired;
dic["id"] = (System.Int32)source.ID;
dic["issued_by"] = (System.String)source.IssuedBy;
dic["reason"] = (System.String)source.Reason;
dic["start_time"] = (System.DateTime)source.StartTime;
}