LoadNode() public method

public LoadNode ( TransactionalNodeService.Proxy relationship, TransactionalNodeService.Proxy node ) : void
relationship TransactionalNodeService.Proxy
node TransactionalNodeService.Proxy
return void
Example #1
0
        public override void QueryCompleted(TransactionalNodeService.Proxy.NodesEventArgs e)
        {
            var context = (Guid)e.Context;

            var isMapLoaded = false;

            if (context != Guid.Empty)
            {
                if (e.Nodes != null && e.Nodes.Values != null)
                {
                    foreach (var node in e.Nodes.Values)
                    {
                        if (node.Id == context)
                        {
                            if (node.NodeType == MapManager.NodeTypes["CompendiumMapNode"])
                            {
                                ControllerContainer.SuperGraphController.ChangeContextAsync(node);

                                var viewModelNode = new Node(MapManager);
                                viewModelNode.LoadNode(null, node);
                                var breadcrumb = new BreadcrumbItem(viewModelNode);
                                Breadcrumbs.BreadcrumbTrail.Add(breadcrumb);

                                Preloader.LoadParentBreadcrumb(node);
                                isMapLoaded = true;
                                break;
                            }
                        }
                    }
                }
            }

            if (isMapLoaded)
            {
                LoadCompleted();
            }
            else
            {
                LoadFailed();
            }

            base.QueryCompleted(e);
        }
Example #2
0
        private void QueryMapByDomain(object sender, Proxy.NodesEventArgs eventArgs)
        {
            var context = (Guid)eventArgs.Context;

            foreach (var node in eventArgs.Nodes.Values)
            {
                // The following line appears to be inherently incorrect. It relies on the fact that the first node will be the context.
                //if (node.NodeType == _mapManager.NodeTypes["CompendiumMapNode"])
                // The following line replaces the above line.
                if (node.Id == context)
                {
                    var viewModelNode = new Node(_mapManager);
                    viewModelNode.LoadNode(null, node);
                    viewModelNode.IsRootMap = true;
                    var breadcrumb = new BreadcrumbItem(viewModelNode);
                    Breadcrumbs.BreadcrumbTrail.Add(breadcrumb);

                    _superGraphController.ChangeContextAsync(node);
                    break;
                }
            }


        }