コード例 #1
0
        private void TrimLogs()
        {
            //keep the logs to a size of 'logMaxLength'
            if (chatLog.Count > logMaxLength)
            {
                chatLog.RemoveRange(logMaxLength, (chatLog.Count - logMaxLength));
                chatLog.TrimExcess();
            }

            if (sayLog.Count > logMaxLength)
            {
                sayLog.RemoveRange(logMaxLength, (sayLog.Count - logMaxLength));
                sayLog.TrimExcess();
            }

            if (partyLog.Count > logMaxLength)
            {
                partyLog.RemoveRange(logMaxLength, (partyLog.Count - logMaxLength));
                partyLog.TrimExcess();
            }

            if (shellLog.Count > logMaxLength)
            {
                shellLog.RemoveRange(logMaxLength, (shellLog.Count - logMaxLength));
                shellLog.TrimExcess();
            }

            if (tellLog.Count > logMaxLength)
            {
                tellLog.RemoveRange(logMaxLength, (tellLog.Count - logMaxLength));
                tellLog.TrimExcess();
            }

            if (fishLog.Count > logMaxLength)
            {
                fishLog.RemoveRange(logMaxLength, (fishLog.Count - logMaxLength));
                fishLog.TrimExcess();
            }

            if (shoutLog.Count > logMaxLength)
            {
                shoutLog.RemoveRange(logMaxLength, (shoutLog.Count - logMaxLength));
                shoutLog.TrimExcess();
            }
            if (BattleLog.Count > logMaxLength)
            {
                BattleLog.RemoveRange(logMaxLength, (BattleLog.Count - logMaxLength));
                BattleLog.TrimExcess();
            }
        }