Пример #1
0
        public CoordinateSystemCategory(CoordinateSystemCategory parent) : base(parent)
        {
            _children = new ObservableCollection <CoordinateSystemTreeNode>();

            Children = CollectionViewSource.GetDefaultView(_children);

            ((ListCollectionView)Children).CustomSort = CoordinateSystemComparer.NonGeneric;
            ((ListCollectionView)Children).Filter     = (o) => o is CoordinateSystemTreeNode node &&
                                                        (node.Parent == null || IsNoFilter(Filter) || node.Matches(Filter) || node.HasChildMatching(Filter));
        }
Пример #2
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);
        }
Пример #3
0
        public async static Task <ICollectionView> Build(CoordinateSystemFilter filter)
        {
            var root = new CoordinateSystemCategory(null)
            {
                NodeObject = "root"
            };
            var coordinateSystems = await QueuedTask.Run(() =>
            {
                return(GeometryEngine.Instance.GetPredefinedCoordinateSystemList(filter));
            });

            foreach (var coordinateSystem in coordinateSystems)
            {
                root.Add(coordinateSystem.Category.Split('/'), coordinateSystem);
            }
            return(root.Children); // ignoring root node
        }
Пример #4
0
 public CoordinateSystemItem(CoordinateSystemCategory parent) : base(parent)
 {
 }