Ejemplo n.º 1
0
        public void LogErrorCheckResult()
        {
            MultiMapSet <string, string> dict = Check();

            if (dict.Count == 0)
            {
                return;
            }
            StringBuilder sb = new StringBuilder();

            sb.Append("not reset field:\n");
            foreach (KeyValuePair <string, HashSet <string> > pair in dict.GetDictionary())
            {
                sb.Append(pair.Key + ": ");
                foreach (string value in pair.Value)
                {
                    sb.Append(value + ", ");
                }
                sb.Append("\n");
            }
            Log.Error(sb.ToString());
        }
Ejemplo n.º 2
0
        public override string ToString()
        {
            StringBuilder          sb        = new StringBuilder();
            Dictionary <Type, int> typeCount = new Dictionary <Type, int>();

            foreach (var kv in this.dictionary)
            {
                typeCount[kv.Key] = kv.Value.Count;
            }

            IOrderedEnumerable <KeyValuePair <Type, int> > orderByDescending = typeCount.OrderByDescending(s => s.Value);

            sb.AppendLine("ObjectPool Count: ");
            foreach (var kv in orderByDescending)
            {
                if (kv.Value == 1)
                {
                    continue;
                }
                sb.AppendLine($"\t{kv.Key.Name}: {kv.Value}");
            }

            MultiMapSet <string, string> dict = Check();

            sb.Append("not reset field:\n");
            foreach (KeyValuePair <string, HashSet <string> > pair in dict.GetDictionary())
            {
                sb.Append(pair.Key + ": ");
                foreach (string value in pair.Value)
                {
                    sb.Append(value + ", ");
                }
                sb.Append("\n");
            }

            return(sb.ToString());
        }