Example #1
0
 private void AddItem(CoordinateSystemListEntry coordinateSystem)
 {
     if (Items.Any(i => i.NodeObject is CoordinateSystemListEntry entry && entry.Name == coordinateSystem.Name))
     {
         return; // already added
     }
     _children.Add(new CoordinateSystemItem(this)
     {
         NodeObject = coordinateSystem
     });
 }
Example #2
0
 public void Add(string[] categories, CoordinateSystemListEntry coordinateSystem)
 {
     if (categories.Count() == 0)
     {
         AddItem(coordinateSystem);
     }
     else
     {
         AddCategory(categories, coordinateSystem);
     }
 }
Example #3
0
        private void AddCategory(string[] categories, CoordinateSystemListEntry coordinateSystem)
        {
            var category = Categories.FirstOrDefault(i => (string)i.Name == categories[0]);

            if (category == null)
            {
                category = new CoordinateSystemCategory(this)
                {
                    NodeObject = categories[0]
                };
                _children.Add(category);
            }
            category.Add(categories.Skip(1).ToArray(), coordinateSystem);
        }