Ejemplo n.º 1
0
        private void GetCustomTables()
        {
            if (!Directory.Exists(Location))
            {
                return;
            }

            try
            {
                var files = Directory.GetFiles(Location, "*.jsond");

                foreach (var f in files)
                {
                    var d = DeviceCollection.Deserialize(File.ReadAllText(f));
                    if (d.Name == null)
                    {
                        d.Name = Path.GetFileNameWithoutExtension(f);
                    }

                    if (!tables.ContainsKey(d.Name))
                    {
                        tables.Add(d.Name, d);
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error($"GetCustomTables error: {ex.Message}");
            }
        }