Ejemplo n.º 1
0
        private void OnParentBreadcrumbQueryCompleted(object sender, TransactionalNodeService.Proxy.NodesEventArgs e)
        {
            var context = (INode)e.Context;

            if (context == null)
            {
                throw new ArgumentNullException("Context shouldn't be empty.");
            }

            if (e.Nodes != null && e.Nodes.Values != null)
            {
                foreach (INode node in e.Nodes.Values)
                {
                    if (node.Id == context.Id)
                    {
                        var maps = node.FindContainerMapsOfNode(MapManager);

                        if (maps.Count > 0)
                        {
                            LoadParentMaps(maps, Guid.Empty);
                        }
                        else
                        {
                            Breadcrumbs.BreadcrumbTrail.RootMapFound();
                        }
                        break;
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public VideoSizeHelper(TransactionalNodeService.Proxy.INode nodeContext)
 {
     IMetadataSet videoSizeMetadata = nodeContext.Metadata.FindMetadata("Video.Size");
     if (videoSizeMetadata != null)
     {
         Size = ParseVideoSize(videoSizeMetadata.Value);
     }
 }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
0
 public virtual void QueryCompleted(TransactionalNodeService.Proxy.NodesEventArgs e)
 {
     
 }
Ejemplo n.º 5
0
 private void OnQueryMapCompleted(object sender, TransactionalNodeService.Proxy.NodesEventArgs e)
 {
     Preloader.InitialiseControllers();
     QueryCompleted(e);
 }
Ejemplo n.º 6
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.RootMapId == context)
                            {
                                ControllerContainer.SuperGraphController.ChangeContextAsync(node);
                                var viewModelNode = new SuperGraph.ViewModel.Node(MapManager);
                                viewModelNode.LoadNode(null, node);
                                var breadcrumb = new BreadcrumbItem(viewModelNode);
                                Breadcrumbs.BreadcrumbTrail.Add(breadcrumb);
                                isMapLoaded = true;
                            }
                            else
                            {
                                var maps = node.FindContainerMapsOfNode(MapManager);

                                if (maps.Count > 0)
                                {
                                    INode firstMapLoaded;
                                    if (MapUid == Guid.Empty)
                                    {
                                        firstMapLoaded = maps.FirstOrDefault();
                                    }
                                    else
                                    {
                                        firstMapLoaded = maps.FirstOrDefault(q => q.Id == MapUid);
                                    }

                                    if (firstMapLoaded != null)
                                    {
                                        ControllerContainer.SuperGraphController.ChangeContextAsync(firstMapLoaded);

                                        var index = maps.IndexOf(firstMapLoaded);

                                        if (index > 0)
                                        {
                                            maps.RemoveAt(index);
                                            maps.Insert(0, firstMapLoaded);
                                        }

                                        Preloader.LoadParentMaps(maps, MapUid);

                                        Preloader.LoadParentBreadcrumb(firstMapLoaded);

                                        isMapLoaded = true;
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }

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

            base.QueryCompleted(e);
        }
Ejemplo n.º 7
0
 public NodeProperties(TransactionalNodeService.Proxy.INode node)
 {
     _node = new Node(node);
 }