From d180bfb9e175032e8d3429645be4aafde3019c2f Mon Sep 17 00:00:00 2001 From: lastvoidtemplar Date: Mon, 12 Jul 2021 12:59:05 +0300 Subject: [PATCH] Create WarningStat.cs --- .../BoerseDataConvert/Model/WarningStat.cs | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 BoerseDataConvert/BoerseDataConvert/Model/WarningStat.cs diff --git a/BoerseDataConvert/BoerseDataConvert/Model/WarningStat.cs b/BoerseDataConvert/BoerseDataConvert/Model/WarningStat.cs new file mode 100644 index 0000000..2d09894 --- /dev/null +++ b/BoerseDataConvert/BoerseDataConvert/Model/WarningStat.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BoerseDataConvert.Model +{ + public static class WarningStat + { + private class Warning + { + string type; + int count; + + public Warning(string type) + { + this.type = type; + count = 1; + } + public void Add() + { + count++; + } + } + + private static Dictionary tableWarnings = tableWarnings = new Dictionary(); + private static string curFile; + public static void Refresh(string fileName) + { + curFile = fileName; + tableWarnings = new Dictionary(); + } + /* + type "inv" - Ivalid tag + type "long" - too long string value + type "notnum" - is not in a valid format for number + type "range" - Value not in range + */ + public static void Add(int tag,string type)// + { + if (tableWarnings.ContainsKey(tag)) + { + tableWarnings[tag].Add(); + } + else + { + Warning warning = new Warning(type); + tableWarnings.Add(tag, warning); + } + } + } +}