private INode BuildTransactionForNode(Node node, ref TransactionChain chain)
        {
            INode newNode = MapManager.CreateNode(Map.DomainId, Map.RootMapId.Value, node.Proxy.NodeType, string.Empty, ref chain);
            IRelationship newMapContainerRelationship = MapManager.CreateRelationship(Map.DomainId, Map.RootMapId.Value, MapContainerRelationshipType, string.Empty, ref chain);

            newMapContainerRelationship.ConnectNode(FromConnectionType, newNode, ref chain);
            newMapContainerRelationship.ConnectNode(ToConnectionType, Map, ref chain);

            newNode.Metadata.Add(newMapContainerRelationship, FromConnectionType, "XPosition", (node.Location.X + 100).ToString(), ref chain);
            newNode.Metadata.Add(newMapContainerRelationship, FromConnectionType, "YPosition", (node.Location.Y + 100).ToString(), ref chain);
            newNode.Metadata.Add(newMapContainerRelationship, FromConnectionType, "CollapseState", "None", ref chain);
            newNode.Metadata.Add(newMapContainerRelationship, FromConnectionType, "Visibility", "Visible", ref chain);

            foreach (var metadata in node.Metadata)
            {
                if (!string.IsNullOrEmpty(metadata.Value.Value))
                {
                    newNode.Metadata.Add(null, null, metadata.Key, metadata.Value.Value, ref chain);
                }
            }

            Response.Nodes.Add(newNode);
            return newNode;
        }
Exemplo n.º 2
0
        private INode BuildTransactionForNode(Node node, ref TransactionChain chain)
        {
            INode         newNode = MapManager.CreateNode(Map.DomainId, Map.RootMapId.Value, node.Proxy.NodeType, string.Empty, ref chain);
            IRelationship newMapContainerRelationship = MapManager.CreateRelationship(Map.DomainId, Map.RootMapId.Value, MapContainerRelationshipType, string.Empty, ref chain);

            newMapContainerRelationship.ConnectNode(FromConnectionType, newNode, ref chain);
            newMapContainerRelationship.ConnectNode(ToConnectionType, Map, ref chain);

            newNode.Metadata.Add(newMapContainerRelationship, FromConnectionType, "XPosition", (node.Location.X + 100).ToString(), ref chain);
            newNode.Metadata.Add(newMapContainerRelationship, FromConnectionType, "YPosition", (node.Location.Y + 100).ToString(), ref chain);
            newNode.Metadata.Add(newMapContainerRelationship, FromConnectionType, "CollapseState", "None", ref chain);
            newNode.Metadata.Add(newMapContainerRelationship, FromConnectionType, "Visibility", "Visible", ref chain);

            foreach (var metadata in node.Metadata)
            {
                if (!string.IsNullOrEmpty(metadata.Value.Value))
                {
                    newNode.Metadata.Add(null, null, metadata.Key, metadata.Value.Value, ref chain);
                }
            }

            Response.Nodes.Add(newNode);
            return(newNode);
        }
Exemplo n.º 3
0
 public CloneNodeOperation(IMapManager mapManager, INode map, Node node)
     : base(mapManager)
 {
     Node = node;
     Map  = map;
 }