예제 #1
0
        private void SpecialMethod()
        {
            var map     = MapInfo.CreateMap();
            var mapinfo = map.mapInfo;

            Table tab = mapinfo.GetTable();



            DMapInfo  inst   = map.mapInfo.instance;
            DMIMapGen mapGen = inst.MIMapGen;
            DMITable  table  = mapGen.GetTable("БТИ_2019");

            DMIFields columns = table.Fields;

            foreach (DMIField col in columns)
            {
                Console.WriteLine(col.Name());
                Console.WriteLine(col.Type());
            }

            DMIRows rows = table.Rows;

            List <string> list = new List <string>();



            foreach (DMIRow row in rows)
            {
                list.Add(row.Value[(object)"VRI"]);
            }

            var set     = new List <string>();
            var pattern = @"\d+[.]\d+([.]\d+)?([.]\d+)?";

            foreach (var val in list)
            {
                if (!string.IsNullOrEmpty(val))
                {
                    var result = Regex.Matches(val, pattern).Cast <Match>().Select(p => p.Value).ToList();
                    set.AddRange(result);
                }
            }

            var res = set.Distinct();

            foreach (var val in res)
            {
                Console.WriteLine(val);
            }
        }
예제 #2
0
 public void GetTableList()
 {
     Tables = new List <DMITable>();
     if (int.TryParse(instance.Eval("NumTables()"), out var amount))
     {
         var it = 1;
         while (it <= amount)
         {
             var tableName = instance.Eval(string.Format("TableInfo({0}, 1)", it));
             if (!String.IsNullOrEmpty(tableName))
             {
                 Tables.Add(mapGen.GetTable(tableName));
             }
             it++;
         }
     }
 }